aboutsummaryrefslogtreecommitdiff
path: root/mammoth/style_reader/document_matcher_reader.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-25 19:06:15 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-25 19:06:15 +0000
commit17ba20787c2637c65df0c02c6ffbd71a318e451a (patch)
tree6f495ef52e4c72aff891ceb29e0ddbd1033c0a43 /mammoth/style_reader/document_matcher_reader.py
parentdd4d8ecda9eb093e276b2fb900f9e41fcd4f0364 (diff)
Parse bold document matcher
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 04a26c0..ee5b467 100644
--- a/mammoth/style_reader/document_matcher_reader.py
+++ b/mammoth/style_reader/document_matcher_reader.py
@@ -18,6 +18,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 == "bold":
+ return document_matchers.bold
def _read_paragraph_node(paragraph_node):
@@ -57,12 +59,14 @@ def _read_list_node(list_node):
return None
grammar_text = r"""
-document_matcher = paragraph / run / underline / strikethrough
+document_matcher = paragraph / run / underline / strikethrough / bold
underline = "u"
strikethrough = "strike"
+bold = "b"
+
paragraph = "p" style_id? style_name_specifier? list?
run = "r" style_id? style_name_specifier?