aboutsummaryrefslogtreecommitdiff
path: root/mammoth/style_reader
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-03 13:45:36 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-03 13:45:36 +0100
commited8acdfd79b014fd002890361593a9b2c1f21534 (patch)
tree5639f30308ccb86bfb684a2256f22caef2f1aa5f /mammoth/style_reader
parent75ad64ef27d5b8fbfa1a54a94c063e69b2c1ce81 (diff)
Add comment reference document matcher
Diffstat (limited to 'mammoth/style_reader')
-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 66f5d19..b22b6a0 100644
--- a/mammoth/style_reader/document_matcher_reader.py
+++ b/mammoth/style_reader/document_matcher_reader.py
@@ -22,6 +22,8 @@ def read_document_matcher_node(root_node):
return document_matchers.underline
elif element_node.expr_name == "strikethrough":
return document_matchers.strikethrough
+ elif element_node.expr_name == "comment_reference":
+ return document_matchers.comment_reference
def _read_paragraph_node(paragraph_node):
@@ -61,7 +63,7 @@ def _read_list_node(list_node):
return None
grammar_text = r"""
-document_matcher = paragraph / run / underline / strikethrough / bold / italic
+document_matcher = paragraph / run / underline / strikethrough / bold / italic / comment_reference
underline = "u"
@@ -71,6 +73,8 @@ bold = "b"
italic = "i"
+comment_reference = "comment-reference"
+
paragraph = "p" style_id? style_name_specifier? list?
run = "r" style_id? style_name_specifier?