diff options
| author | privatmamtora <privat.mamtora@gmail.com> | 2017-11-23 14:33:23 -0500 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-11-23 19:33:23 +0000 |
| commit | 7b8e6250f4a088e3bfc16403ae303406b9134726 (patch) | |
| tree | 56d509826a8ce80c04e6390c99194cc55fc68f56 /lib/docx | |
| parent | e164d0ca975584ecdca37fe47ec44e4da6deab0b (diff) | |
Parse paragraph indents
Diffstat (limited to 'lib/docx')
| -rw-r--r-- | lib/docx/body-reader.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js index e21b422..5958efe 100644 --- a/lib/docx/body-reader.js +++ b/lib/docx/body-reader.js @@ -47,6 +47,15 @@ function BodyReader(options) { return emptyResult(); } + function readParagraphIndent(element) { + return { + start: element.attributes["w:start"] || element.attributes["w:left"], + end: element.attributes["w:end"] || element.attributes["w:right"], + firstLine: element.attributes["w:firstLine"], + hanging: element.attributes["w:hanging"] + }; + } + function readRunProperties(element) { return readRunStyle(element).map(function(style) { return { @@ -182,7 +191,8 @@ function BodyReader(options) { styleId: style.styleId, styleName: style.name, alignment: element.firstOrEmpty("w:jc").attributes["w:val"], - numbering: readNumberingProperties(element.firstOrEmpty("w:numPr"), numbering) + numbering: readNumberingProperties(element.firstOrEmpty("w:numPr"), numbering), + indent: readParagraphIndent(element.firstOrEmpty("w:ind")) }; }); }, |
