aboutsummaryrefslogtreecommitdiff
path: root/mammoth/options.py
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth/options.py')
-rw-r--r--mammoth/options.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/mammoth/options.py b/mammoth/options.py
index 79aec8c..19f9d33 100644
--- a/mammoth/options.py
+++ b/mammoth/options.py
@@ -11,10 +11,17 @@ def read_options(options):
def _read_style_map(style_text):
- lines = filter(None, map(lambda line: line.strip(), style_text.split("\n")))
+ lines = filter(None, map(_get_line, style_text.split("\n")))
return lists.map(style_reader.read_style, lines)
+def _get_line(line):
+ line = line.strip()
+ if line.startswith("#"):
+ return None
+ else:
+ return line
+
_default_style_map = _read_style_map("""
p[style-name='Normal'] => p:fresh
@@ -35,6 +42,12 @@ p[style-name='heading 4'] => h4:fresh
p[style-name='footnote text'] => p
r[style-name='footnote reference'] =>
+
+# LibreOffice
+p[style-name='Footnote'] => p
+r[style-name='Footnote anchor'] =>
+p[style-name='Endnote'] => p
+r[style-name='Endnote anchor'] =>
p:unordered-list(1) => ul > li:fresh
p:unordered-list(2) => ul|ol > li > ul > li:fresh