diff options
| author | Bruno Herfst <hello@brunoherfst.com> | 2016-10-26 11:04:09 +1100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-12-10 23:07:48 +0000 |
| commit | bc8c341b37bfac34bbeaccdd5368c2d7edc309ac (patch) | |
| tree | 5c18d634763f5f6ae0defeb07368f0ae28d8ef4d /mammoth/document_matchers.py | |
| parent | 8661cad2a82b66254fff564f4a514cbd67ad371d (diff) | |
Add support for page and column breaks
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()) |
