-
-
Notifications
You must be signed in to change notification settings - Fork 15
Error parsing styles with spaces #73
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I have the folllowing example:
from html4docx import HtmlToDocx
html = """
<table >
<tbody>
<tr >
<th style="border-top: 1px solid rgb(222, 222, 222)">
content
</th>
</tr>
</tbody>
</table>
"""
HtmlToDocx().parse_html_string(html)
It fails with
WARNING:root:Could not parse color 'rgb(222,': Invalid color value. Fallback to black.
When I change the border color to use rgb(222, 222, 222) everything works perfectly.
It is importation to mention, that border: 1px solid rgb(222, 222, 222) doesn't fail! But I don't think that it works corectly!
Maybe it's better to use an external library for css parsing. Unfortunately I found only one active CSS library: https://pypi.org/project/tinycss2/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working