diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-01 13:30:53 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-01 13:30:53 +0000 |
| commit | ff8b54b819c08e97cc35dc123fdb4b64969d4ef6 (patch) | |
| tree | d33f947d16c55d3cadad99342c76bfdfd905cd77 /mammoth | |
| parent | 4a35a848117c4fe646d36419096d099030878469 (diff) | |
Read run style from run properties
Diffstat (limited to 'mammoth')
| -rw-r--r-- | mammoth/docx/document_xml.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mammoth/docx/document_xml.py b/mammoth/docx/document_xml.py index 403f880..c3fb1b7 100644 --- a/mammoth/docx/document_xml.py +++ b/mammoth/docx/document_xml.py @@ -22,7 +22,11 @@ def _create_reader(numbering): @handler("w:r") def run(element): - return documents.run(_read_xml_elements(element.children)) + properties = element.find_child_or_null("w:rPr") + style_name = properties \ + .find_child_or_null("w:rStyle") \ + .attributes.get("w:val") + return documents.run(_read_xml_elements(element.children), style_name) @handler("w:p") |
