Skip to content

Commit

Permalink
Fixed style name.
Browse files Browse the repository at this point in the history
  • Loading branch information
rossant committed Mar 29, 2015
1 parent 4eca9c8 commit 709e975
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ipymd/lib/opendocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@
# Utility functions
# -----------------------------------------------------------------------------

_STYLE_NAME = ('urn:oasis:names:tc:opendocument:xmlns:style:1.0',
'display-name')
_STYLE_NAMES = (('urn:oasis:names:tc:opendocument:xmlns:style:1.0',
'display-name'),
('urn:oasis:names:tc:opendocument:xmlns:style:1.0',
'name'))


def _show_attrs(el):
Expand Down Expand Up @@ -266,7 +268,11 @@ def _add_style(name, **kwargs):


def _style_name(el):
return el.attributes.get(_STYLE_NAME, '').strip()
for name in _STYLE_NAMES:
out = el.attributes.get(name, '').strip()
if out:
return out
return ''


def load_styles(path_or_doc):
Expand Down

0 comments on commit 709e975

Please sign in to comment.