aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/docx/body-reader.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js
index dd76c5c..fa2ac83 100644
--- a/lib/docx/body-reader.js
+++ b/lib/docx/body-reader.js
@@ -1,6 +1,8 @@
exports.createBodyReader = createBodyReader;
exports._readNumberingProperties = readNumberingProperties;
+var url = require("url");
+
var _ = require("underscore");
var documents = require("../documents");
@@ -210,6 +212,9 @@ function BodyReader(options) {
return readXmlElements(element.children).map(function(children) {
if (relationshipId) {
var href = relationships[relationshipId].target;
+ if (anchor) {
+ href = url.resolve(href, "#" + anchor);
+ }
return new documents.Hyperlink(children, {href: href});
} else if (anchor) {
return new documents.Hyperlink(children, {anchor: anchor});