diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-02-11 20:22:54 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-02-11 20:22:54 +0000 |
| commit | 7ba9cc0ecdca695fec3cb90c98dd383e0edb2ba9 (patch) | |
| tree | 560f9225fd1a0c2620fdd143109cb85ee58b721c /mammoth/documents.py | |
| parent | 8d61b083270af4e98ee2411261067a3dd8e48851 (diff) | |
Read anchor from hyperlinks
Diffstat (limited to 'mammoth/documents.py')
| -rw-r--r-- | mammoth/documents.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mammoth/documents.py b/mammoth/documents.py index 1adcc0d..9028b03 100644 --- a/mammoth/documents.py +++ b/mammoth/documents.py @@ -8,7 +8,7 @@ Run = dodge.data_class("Run", [ "is_underline", "vertical_alignment", ]) Text = dodge.data_class("Text", ["value"]) -Hyperlink = dodge.data_class("Hyperlink", ["href", "children"]) +Hyperlink = dodge.data_class("Hyperlink", ["href", "anchor", "children"]) Table = dodge.data_class("Table", ["children"]) TableRow = dodge.data_class("TableRow", ["children"]) TableCell = dodge.data_class("TableCell", ["children"]) @@ -55,7 +55,11 @@ def tab(): image = Image -hyperlink = Hyperlink + +def hyperlink(children, href=None, anchor=None): + return Hyperlink(href, anchor, children) + + table = Table table_row = TableRow table_cell = TableCell |
