diff --git a/src/wireviz/wv_html.py b/src/wireviz/wv_html.py
index 7721dd4..ee8a4e0 100644
--- a/src/wireviz/wv_html.py
+++ b/src/wireviz/wv_html.py
@@ -24,11 +24,10 @@ def generate_html_output(filename: Union[str, Path], bom_list: List[List[str]],
# embed SVG diagram
with open_file_read(f'{filename}.svg') as file:
- svgdata = file.read()
svgdata = re.sub(
- '^<[?]xml [^?>]*[?]>[^<]*]*>',
- '',
- svgdata, 1)
+ '^<[?]xml [^?>]*[?]>[^<]*]*>',
+ '',
+ file.read(), 1)
# generate BOM table
bom = flatten2d(bom_list)
@@ -57,7 +56,7 @@ def generate_html_output(filename: Union[str, Path], bom_list: List[List[str]],
replacements = {
'': f'{APP_NAME} {__version__} - {APP_URL}',
'': options.fontname,
- '': options.bgcolor, # TODO: currently not working, requires translation from 2-char color code to HTML
+ '': wv_colors.translate_color(options.bgcolor, "hex"),
'': svgdata,
'': bom_html,
'': bom_html_reversed,