From 8fde170b06becb51d2650b60dd28e23eaf862e25 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 5 Nov 2020 19:43:01 +0000 Subject: Add style mapping for all caps --- mammoth/document_matchers.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mammoth/document_matchers.py') diff --git a/mammoth/document_matchers.py b/mammoth/document_matchers.py index 91adf3f..f831b8a 100644 --- a/mammoth/document_matchers.py +++ b/mammoth/document_matchers.py @@ -43,6 +43,10 @@ class strikethrough(object): element_type = "strikethrough" +class all_caps(object): + element_type = "all_caps" + + class small_caps(object): element_type = "small_caps" @@ -66,8 +70,8 @@ def equal_to(value): def _operator_equal_to(first, second): return first.upper() == second.upper() - - + + def starts_with(value): return StringMatcher(_operator_starts_with, value) @@ -79,6 +83,6 @@ def _operator_starts_with(first, second): class StringMatcher(object): operator = cobble.field() value = cobble.field() - + def matches(self, other): return self.operator(self.value, other) -- cgit v1.2.3