Skip to content

Commit c9286fa

Browse files
committed
Preprocess: write HTML dirtectly to file
1 parent 8b05101 commit c9286fa

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

commands/preprocess_cssless.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def preprocess_html_merge_css(src_path, dst_path):
6060
strip_elements(tree, *nondata_tags)
6161

6262
with open(dst_path, 'wb') as a_file:
63-
a_file.write(etree.tostring(tree.getroot(), pretty_print=True,
64-
method="html", encoding = 'utf-8'))
63+
tree.write(dst_path, pretty_print=True, method="html",
64+
encoding='utf-8')
6565

6666
return output.getvalue()

tests/preprocess_cssless_data/multiset_expected.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html lang="en" dir="ltr" style='font-family:"DejaVu Sans", arial, sans-serif; font-size:1em'>
23
<head>
34
<title>std::multiset - cppreference.com</title>

0 commit comments

Comments
 (0)