summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-28 17:59:14 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-28 17:59:14 +0000
commitbb3d113828218fa29dae16cae6f2ff5e05e48564 (patch)
tree3eef75e7004185852fba00f0e0366888d37609a0 /lib
parent611e0c9af7c1948ad46c5471a426ec751e73a1ea (diff)
Change LineBreak to Break with a break type
Diffstat (limited to 'lib')
-rw-r--r--lib/document-to-html.js2
-rw-r--r--lib/documents.js9
-rw-r--r--lib/docx/body-reader.js2
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js
index d223d82..2591e4f 100644
--- a/lib/document-to-html.js
+++ b/lib/document-to-html.js
@@ -349,7 +349,7 @@ function DocumentConversion(options, comments) {
"table": convertTable,
"tableRow": convertTableRow,
"tableCell": convertTableCell,
- "lineBreak": function(element, messages) {
+ "break": function(element, messages) {
return [Html.freshElement("br")];
}
};
diff --git a/lib/documents.js b/lib/documents.js
index fc45627..cb62939 100644
--- a/lib/documents.js
+++ b/lib/documents.js
@@ -15,7 +15,7 @@ var types = exports.types = {
table: "table",
tableRow: "tableRow",
tableCell: "tableCell",
- lineBreak: "lineBreak",
+ "break": "break",
bookmarkStart: "bookmarkStart"
};
@@ -170,9 +170,10 @@ function TableCell(children, options) {
};
}
-function LineBreak() {
+function Break(breakType) {
return {
- type: types.lineBreak
+ type: types["break"],
+ breakType: breakType
};
}
@@ -198,7 +199,7 @@ exports.Image = Image;
exports.Table = Table;
exports.TableRow = TableRow;
exports.TableCell = TableCell;
-exports.LineBreak = LineBreak;
+exports.lineBreak = Break("line");
exports.BookmarkStart = BookmarkStart;
exports.verticalAlignment = verticalAlignment;
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js
index 8c403be..c4a61f0 100644
--- a/lib/docx/body-reader.js
+++ b/lib/docx/body-reader.js
@@ -177,7 +177,7 @@ function BodyReader(options) {
if (breakType) {
return emptyResultWithMessages([warning("Unsupported break type: " + breakType)]);
} else {
- return elementResult(new documents.LineBreak());
+ return elementResult(documents.lineBreak);
}
},
"w:bookmarkStart": function(element){