aboutsummaryrefslogtreecommitdiff
path: root/mammoth/styles/parser
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-11-04 11:25:51 +0000
committerMichael Williamson <mike@zwobble.org>2017-11-04 11:25:51 +0000
commitade2f7706813d785345563c57e7baf902ea2a7f4 (patch)
tree5003acc0e03415dbe3eb71e2f35cbd8285661975 /mammoth/styles/parser
parent1498397f4ede71d81ec79f380d43ec041438a047 (diff)
Add style mappings for tables
Diffstat (limited to 'mammoth/styles/parser')
-rw-r--r--mammoth/styles/parser/document_matcher_parser.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/mammoth/styles/parser/document_matcher_parser.py b/mammoth/styles/parser/document_matcher_parser.py
index 034c59c..b9e09f3 100644
--- a/mammoth/styles/parser/document_matcher_parser.py
+++ b/mammoth/styles/parser/document_matcher_parser.py
@@ -24,7 +24,16 @@ def parse_document_matcher(tokens):
style_id=style_id,
style_name=style_name,
)
-
+
+ elif tokens.try_skip(TokenType.IDENTIFIER, "table"):
+ style_id = try_parse_class_name(tokens)
+ style_name = _parse_style_name(tokens)
+
+ return document_matchers.table(
+ style_id=style_id,
+ style_name=style_name,
+ )
+
elif tokens.try_skip(TokenType.IDENTIFIER, "b"):
return document_matchers.bold