diff options
Diffstat (limited to 'mammoth/document_matchers.py')
| -rw-r--r-- | mammoth/document_matchers.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mammoth/document_matchers.py b/mammoth/document_matchers.py index d1f8e74..faccb50 100644 --- a/mammoth/document_matchers.py +++ b/mammoth/document_matchers.py @@ -39,6 +39,15 @@ class comment_reference(object): element_type = "comment_reference" +BreakMatcher = collections.namedtuple("BreakMatcher", ["break_type"]) +BreakMatcher.element_type = "break" + + +line_break = BreakMatcher("line") +page_break = BreakMatcher("page") +column_break = BreakMatcher("column") + + def equal_to(value): return StringMatcher(_operator_equal_to, value) @@ -50,7 +59,6 @@ def _operator_equal_to(first, second): def starts_with(value): return StringMatcher(_operator_starts_with, value) - def _operator_starts_with(first, second): return second.upper().startswith(first.upper()) |
