aboutsummaryrefslogtreecommitdiff
path: root/mammoth/style_reader/document_matcher_reader.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-05-11 18:01:31 +0100
committerMichael Williamson <mike@zwobble.org>2014-05-11 18:01:31 +0100
commit61e88321b9e5dc67a0373edc69f8114db8c1d3b7 (patch)
tree3f43fd006b6c095f91c2424086b273928881336c /mammoth/style_reader/document_matcher_reader.py
parent7e57058cf120717cc2d2fea3b897b12c3891b28a (diff)
Rename existing concept of style names to style IDs to match docx
Diffstat (limited to 'mammoth/style_reader/document_matcher_reader.py')
-rw-r--r--mammoth/style_reader/document_matcher_reader.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/mammoth/style_reader/document_matcher_reader.py b/mammoth/style_reader/document_matcher_reader.py
index 44a9896..5b50f24 100644
--- a/mammoth/style_reader/document_matcher_reader.py
+++ b/mammoth/style_reader/document_matcher_reader.py
@@ -17,14 +17,14 @@ def read_document_matcher_node(root_node):
def _read_paragraph_node(paragraph_node):
- style_name = _read_style_node(paragraph_node.children[1])
+ style_id = _read_style_node(paragraph_node.children[1])
numbering = _read_list_node(paragraph_node.children[2])
- return document_matchers.paragraph(style_name=style_name, numbering=numbering)
+ return document_matchers.paragraph(style_id=style_id, numbering=numbering)
def _read_run_node(run_node):
- style_name = _read_style_node(run_node.children[1])
- return document_matchers.run(style_name=style_name)
+ style_id = _read_style_node(run_node.children[1])
+ return document_matchers.run(style_id=style_id)
def _read_style_node(style_node):
@@ -46,11 +46,11 @@ def _read_list_node(list_node):
grammar_text = r"""
document_matcher = paragraph / run
-paragraph = "p" style_name? list?
+paragraph = "p" style_id? list?
-run = "r" style_name?
+run = "r" style_id?
-style_name = "." style_identifier
+style_id = "." style_identifier
style_identifier = ~"[A-Z0-9]*"i