diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-06-08 22:04:19 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-06-08 22:04:19 +0100 |
| commit | 3c525db3fba3e408db289b4714352b9cdde797db (patch) | |
| tree | 439d4d72ed1f5d80d5c952a3b852dc388e14b878 /mammoth | |
| parent | fc4b652532f0611e4cbaaf2b6558a70ff265ef9c (diff) | |
Read name of style
Diffstat (limited to 'mammoth')
| -rw-r--r-- | mammoth/docx/styles_xml.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mammoth/docx/styles_xml.py b/mammoth/docx/styles_xml.py index 22c8899..c220740 100644 --- a/mammoth/docx/styles_xml.py +++ b/mammoth/docx/styles_xml.py @@ -31,7 +31,8 @@ def read_styles_xml_element(element): def _read_style_element(element): element_type = element.attributes["w:type"] style_id = element.attributes["w:styleId"] - return Style(element_type=element_type, style_id=style_id) + name = element.find_child("w:name").attributes["w:val"] + return Style(element_type=element_type, style_id=style_id, name=name) -Style = collections.namedtuple("Style", ["element_type", "style_id"]) +Style = collections.namedtuple("Style", ["element_type", "style_id", "name"]) |
