aboutsummaryrefslogtreecommitdiff
path: root/mammoth/docx
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-01 13:30:53 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-01 13:30:53 +0000
commitff8b54b819c08e97cc35dc123fdb4b64969d4ef6 (patch)
treed33f947d16c55d3cadad99342c76bfdfd905cd77 /mammoth/docx
parent4a35a848117c4fe646d36419096d099030878469 (diff)
Read run style from run properties
Diffstat (limited to 'mammoth/docx')
-rw-r--r--mammoth/docx/document_xml.py6
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")