aboutsummaryrefslogtreecommitdiff
path: root/mammoth/style_reader/document_matcher_reader.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-06-17 15:05:19 +0100
committerMichael Williamson <mike@zwobble.org>2015-06-17 15:05:19 +0100
commit147fabb2b2e00f7790304b7a1e1f40cdb564cb4f (patch)
treefcd72fdbdf3681acd1dff8dd6237143a80914cfa /mammoth/style_reader/document_matcher_reader.py
parent35d3dd58400d5310fe05ebe8e070c96c756edac0 (diff)
Support underlines in style map
Diffstat (limited to 'mammoth/style_reader/document_matcher_reader.py')
-rw-r--r--mammoth/style_reader/document_matcher_reader.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mammoth/style_reader/document_matcher_reader.py b/mammoth/style_reader/document_matcher_reader.py
index 3dc9892..56c4626 100644
--- a/mammoth/style_reader/document_matcher_reader.py
+++ b/mammoth/style_reader/document_matcher_reader.py
@@ -14,6 +14,8 @@ def read_document_matcher_node(root_node):
return _read_paragraph_node(element_node)
elif element_node.expr_name == "run":
return _read_run_node(element_node)
+ elif element_node.expr_name == "underline":
+ return document_matchers.underline
def _read_paragraph_node(paragraph_node):
@@ -53,7 +55,9 @@ def _read_list_node(list_node):
return None
grammar_text = r"""
-document_matcher = paragraph / run
+document_matcher = paragraph / run / underline
+
+underline = "u"
paragraph = "p" style_id? style_name_specifier? list?