From 4a779b8d4fe83a80d99324a947b714c76468a88f Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 13 Jun 2024 12:16:25 +0100 Subject: Support style mapping for highlights --- mammoth/document_matchers.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mammoth/document_matchers.py') 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" -- cgit v1.2.3