diff options
| author | Michael Williamson <mike@zwobble.org> | 2020-11-05 19:43:01 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2020-11-05 19:43:01 +0000 |
| commit | 8fde170b06becb51d2650b60dd28e23eaf862e25 (patch) | |
| tree | 3e804a680218dabe24470ea71b7cdadb6e0d3fb3 /mammoth/document_matchers.py | |
| parent | fd10b8d93b361e80bb1fc5b19f19465fc51d9b77 (diff) | |
Add style mapping for all caps
Diffstat (limited to 'mammoth/document_matchers.py')
| -rw-r--r-- | mammoth/document_matchers.py | 10 |
1 files changed, 7 insertions, 3 deletions
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) |
