Skip to content

Commit

Permalink
Run build-prod
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitri-gb committed Apr 16, 2024
1 parent ec0ba32 commit 2a08efd
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/docx-preview.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/docx-preview.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/docx-preview.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/docx-preview.min.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/docx-preview.min.mjs.map

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions dist/docx-preview.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ var DomType;
DomType["Row"] = "row";
DomType["Cell"] = "cell";
DomType["Hyperlink"] = "hyperlink";
DomType["SmartTag"] = "smartTag";
DomType["Drawing"] = "drawing";
DomType["Image"] = "image";
DomType["Text"] = "text";
Expand Down Expand Up @@ -1754,6 +1755,9 @@ class DocumentParser {
case "hyperlink":
result.children.push(this.parseHyperlink(el, result));
break;
case "smartTag":
result.children.push(this.parseSmartTag(el, result));
break;
case "bookmarkStart":
result.children.push(parseBookmarkStart(el, globalXmlParser));
break;
Expand Down Expand Up @@ -1827,6 +1831,23 @@ class DocumentParser {
});
return result;
}
parseSmartTag(node, parent) {
var result = { type: DomType.SmartTag, parent, children: [] };
var uri = globalXmlParser.attr(node, "uri");
var element = globalXmlParser.attr(node, "element");
if (uri)
result.uri = uri;
if (element)
result.element = element;
xmlUtil.foreach(node, c => {
switch (c.localName) {
case "r":
result.children.push(this.parseRun(c, result));
break;
}
});
return result;
}
parseRun(node, parent) {
var result = { type: DomType.Run, parent: parent, children: [] };
xmlUtil.foreach(node, c => {
Expand Down Expand Up @@ -3222,6 +3243,8 @@ section.${c}>footer { z-index: 1; }
return this.renderTableCell(elem);
case DomType.Hyperlink:
return this.renderHyperlink(elem);
case DomType.SmartTag:
return this.renderSmartTag(elem);
case DomType.Drawing:
return this.renderDrawing(elem);
case DomType.Image:
Expand Down Expand Up @@ -3372,6 +3395,11 @@ section.${c}>footer { z-index: 1; }
}
return result;
}
renderSmartTag(elem) {
var result = this.createElement("span");
this.renderChildren(elem, result);
return result;
}
renderCommentRangeStart(commentStart) {
if (!this.options.renderComments)
return null;
Expand Down
2 changes: 1 addition & 1 deletion dist/docx-preview.mjs.map

Large diffs are not rendered by default.

0 comments on commit 2a08efd

Please sign in to comment.