aboutsummaryrefslogtreecommitdiff
path: root/test/docx
diff options
context:
space:
mode:
authorNikolay Yakimov <root@livid.pp.ru>2019-09-15 01:40:23 +0300
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-21 11:18:15 -0700
commitc113ca6717d00870ec10716897d76a6fa62b1d41 (patch)
tree3855697f666c24b7a11b49a9bc5429984e86b270 /test/docx
parentfd14ad52618c98928ab83aa43689158cc788c4a8 (diff)
downloadpandoc-c113ca6717d00870ec10716897d76a6fa62b1d41.tar.gz
[Docx Reader] Use style names, not ids, for assigning semantic meaning
Motivating issues: #5523, #5052, #5074 Style name comparisons are case-insensitive, since those are case-insensitive in Word. w:styleId will be used as style name if w:name is missing (this should only happen for malformed docx and is kept as a fallback to avoid failing altogether on malformed documents) Block quote detection code moved from Docx.Parser to Readers.Docx Code styles, i.e. "Source Code" and "Verbatim Char" now honor style inheritance Docx Reader now honours "Compact" style (used in Pandoc-generated docx). The side-effect is that "Compact" style no longer shows up in docx+styles output. Styles inherited from "Compact" will still show up. Removed obsolete list-item style from divsToKeep. That didn't really do anything for a while now. Add newtypes to differentiate between style names, ids, and different style types (that is, paragraph and character styles) Since docx style names can have spaces in them, and pandoc-markdown classes can't, anywhere when style name is used as a class name, spaces are replaced with ASCII dashes `-`. Get rid of extraneous intermediate types, carrying styleId information. Instead, styleId is saved with other style data. Use RunStyle for inline style definitions only (lacking styleId and styleName); for Character Styles use CharStyle type (which is basicaly RunStyle with styleId and StyleName bolted onto it).
Diffstat (limited to 'test/docx')
-rw-r--r--test/docx/compact-style-removal.docxbin0 -> 9951 bytes
-rw-r--r--test/docx/compact-style-removal.native5
-rw-r--r--test/docx/lists-compact.docxbin0 -> 9952 bytes
-rw-r--r--test/docx/lists-compact.native5
4 files changed, 10 insertions, 0 deletions
diff --git a/test/docx/compact-style-removal.docx b/test/docx/compact-style-removal.docx
new file mode 100644
index 000000000..fde0064db
--- /dev/null
+++ b/test/docx/compact-style-removal.docx
Binary files differ
diff --git a/test/docx/compact-style-removal.native b/test/docx/compact-style-removal.native
new file mode 100644
index 000000000..340878ba0
--- /dev/null
+++ b/test/docx/compact-style-removal.native
@@ -0,0 +1,5 @@
+[OrderedList (1,Decimal,Period)
+ [[Plain [Str "One"]]
+ ,[Plain [Str "Two"]]
+ ,[Plain [Str "Three"]]
+ ,[Plain [Str "Four"]]]]
diff --git a/test/docx/lists-compact.docx b/test/docx/lists-compact.docx
new file mode 100644
index 000000000..d7f9e4a06
--- /dev/null
+++ b/test/docx/lists-compact.docx
Binary files differ
diff --git a/test/docx/lists-compact.native b/test/docx/lists-compact.native
new file mode 100644
index 000000000..340878ba0
--- /dev/null
+++ b/test/docx/lists-compact.native
@@ -0,0 +1,5 @@
+[OrderedList (1,Decimal,Period)
+ [[Plain [Str "One"]]
+ ,[Plain [Str "Two"]]
+ ,[Plain [Str "Three"]]
+ ,[Plain [Str "Four"]]]]