summaryrefslogtreecommitdiff
path: root/mammoth/document_matchers.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-06-13 12:16:25 +0100
committerMichael Williamson <mike@zwobble.org>2024-06-13 12:16:25 +0100
commit4a779b8d4fe83a80d99324a947b714c76468a88f (patch)
tree71e9cd15e8a76beb4d7ec4145234ae70ec4c8dae /mammoth/document_matchers.py
parent0d5b27652c119dfaf99fae5f4e624c9efec408b5 (diff)
Support style mapping for highlights
Diffstat (limited to 'mammoth/document_matchers.py')
-rw-r--r--mammoth/document_matchers.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mammoth/document_matchers.py b/mammoth/document_matchers.py
index f831b8a..5d07d39 100644
--- a/mammoth/document_matchers.py
+++ b/mammoth/document_matchers.py
@@ -51,6 +51,13 @@ class small_caps(object):
element_type = "small_caps"
+def highlight(color=None):
+ return HighlightMatcher(color=color)
+
+
+HighlightMatcher = collections.namedtuple("HighlightMatcher", ["color"])
+HighlightMatcher.element_type = "highlight"
+
class comment_reference(object):
element_type = "comment_reference"