Skip to content
Snippets Groups Projects
Commit db0be5c0 authored by roidelapluie's avatar roidelapluie
Browse files

improve CSS property text-decoration (allow multi text-decoration)

parent e3428713
No related branches found
No related tags found
No related merge requests found
......@@ -477,23 +477,22 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
tag.set_property('justification', align)
def _parse_style_text_decoration(self, tag, value):
if value == 'none':
values = value.split(' ')
if 'none' in values:
tag.set_property('underline', pango.UNDERLINE_NONE)
tag.set_property('strikethrough', False)
elif value == 'underline':
if 'underline' in values:
tag.set_property('underline', pango.UNDERLINE_SINGLE)
tag.set_property('strikethrough', False)
elif value == 'overline':
warnings.warn('text-decoration:overline not implemented')
tag.set_property('underline', pango.UNDERLINE_NONE)
tag.set_property('strikethrough', False)
elif value == 'line-through':
else:
tag.set_property('underline', pango.UNDERLINE_NONE)
if 'line-through' in values:
tag.set_property('strikethrough', True)
elif value == 'blink':
warnings.warn('text-decoration:blink not implemented')
else:
warnings.warn('text-decoration:%s not implemented' % value)
tag.set_property('strikethrough', False)
if 'blink' in values:
warnings.warn('text-decoration:blink not implemented')
if 'overline' in values:
warnings.warn('text-decoration:overline not implemented')
def _parse_style_white_space(self, tag, value):
if value == 'pre':
......@@ -1148,4 +1147,4 @@ if __name__ == '__main__':
w.connect('destroy', lambda w: gtk.main_quit())
gtk.main()
# vim: se ts=3:
\ No newline at end of file
# vim: se ts=3:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment