Skip to content

Commit e68e33b

Browse files
fix: handle SyntaxError for minify_html_onepass (#56)
* fix: handle SyntaxError for minify_html_onepass https://readthedocs.org/projects/dpdata/builds/24380201/ * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 55f8ab4 commit e68e33b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

deepmodeling_sphinx/inject.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ def minify_html_files(app, pagename, templatename, context, doctree):
120120

121121
def render(self, template, render_context):
122122
content = old_render(template, render_context)
123-
return minify_html_onepass.minify(content, minify_js=True)
123+
try:
124+
return minify_html_onepass.minify(
125+
content, minify_js=True, minify_css=True
126+
)
127+
except SyntaxError:
128+
return content
124129

125130
render.__dict__.update(old_render.__dict__)
126131
render._deepmodeling_minified = True

0 commit comments

Comments
 (0)