if 'background-color' in style:
if 'rgb' in style['background-color']:
color = color = re.sub(r'[a-z()]+', '', style['background-color'])
colors = [int(x) for x in color.split(',')]
elif '#' in style['background-color']:
color = style['background-color'].lstrip('#')
colors = tuple(int(color[i:i+2], 16) for i in (0, 2, 4))
else:
colors = [0, 0, 0]
# TODO map colors to named colors (and extended colors...)
# For now set color to black to prevent crashing
self.run.font.highlight_color = WD_COLOR.GRAY_25 #TODO: map colors
Here i will attach a couple of screenshots on how the conversion looks from html to docs
html:
docs:
Can we get to know how this issue can be fixed ?
Is there any work log pending from your side which will be released in the future release ?
Is there any way we can map the colors to the background style ? if yes how it can be done ?
Based on our requirement, when we are converting a HTML to doc we were unable to Get the Background color as expected.
We did run some tests from your test folder https://github.com/pqzx/html2docx/blob/master/tests/text1.html , based on your code on h2d.py even if rgb is present in html the converted doc doesn't show the changes in background color.
code:
Here i will attach a couple of screenshots on how the conversion looks from html to docs
html:
docs:
Can we get to know how this issue can be fixed ?
Is there any work log pending from your side which will be released in the future release ?
Is there any way we can map the colors to the background style ? if yes how it can be done ?