diff options
author | mathieui <mathieui@mathieui.net> | 2017-11-14 19:23:35 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2017-11-14 19:23:35 +0100 |
commit | 156d170d13dd3268728767adf9147e8c4d53d01f (patch) | |
tree | 366020f073c1f2dc7e73f7513a939f4c6b5fcc6b /test | |
parent | bd7b52988c99ef34fd49f52c8a9d335941144450 (diff) | |
download | poezio-156d170d13dd3268728767adf9147e8c4d53d01f.tar.gz poezio-156d170d13dd3268728767adf9147e8c4d53d01f.tar.bz2 poezio-156d170d13dd3268728767adf9147e8c4d53d01f.tar.xz poezio-156d170d13dd3268728767adf9147e8c4d53d01f.zip |
Make italics work
Diffstat (limited to 'test')
-rw-r--r-- | test/test_xhtml.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_xhtml.py b/test/test_xhtml.py index 4f0f2b4f..472991c6 100644 --- a/test/test_xhtml.py +++ b/test/test_xhtml.py @@ -33,6 +33,9 @@ def test_poezio_colors_to_html(): text = '\x19bcoucou\x19o toto \x194}titi' assert poezio_colors_to_html(text) == base + '<span style="font-weight: bold;">coucou</span> toto <span style="color: blue;">titi</span>' + end + text = '\x19icoucou' + assert poezio_colors_to_html(text) == base + '<span style="font-style: italic;">coucou</span>' + end + def test_xhtml_to_poezio_colors(): start = b'<body xmlns="http://www.w3.org/1999/xhtml"><p>' end = b'</p></body>' @@ -45,6 +48,9 @@ def test_xhtml_to_poezio_colors(): xhtml = start + b'<a href="http://perdu.com">http://perdu.com</a>' + end assert xhtml_to_poezio_colors(xhtml) == '\x19uhttp://perdu.com\x19o' + xhtml = start + b'<span style="font-style: italic">Test</span>' + end + assert xhtml_to_poezio_colors(xhtml) == '\x19iTest\x19o' + xhtml = b'<div style="font-weight:bold">Allo <div style="color:red">test <div style="color: blue">test2</div></div></div>' assert xhtml_to_poezio_colors(xhtml, force=True) == '\x19bAllo \x19196}test \x1921}test2\x19o' |