Skip to content

Commit

Permalink
fix: use minify-html instead of minify-html-onepass (#57)
Browse files Browse the repository at this point in the history
* fix: use minify-html instead of minify-html-onepass

xref: wilsonzlin/minify-html#188

* [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>
  • Loading branch information
njzjz and pre-commit-ci[bot] committed May 14, 2024
1 parent e68e33b commit 6400131
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions deepmodeling_sphinx/inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path
from typing import Any, Dict

import minify_html_onepass
import minify_html
from cssmin import cssmin
from jinja2 import Template
from jsmin import jsmin
Expand Down Expand Up @@ -121,9 +121,7 @@ def minify_html_files(app, pagename, templatename, context, doctree):
def render(self, template, render_context):
content = old_render(template, render_context)
try:
return minify_html_onepass.minify(
content, minify_js=True, minify_css=True
)
return minify_html.minify(content, minify_js=True, minify_css=True)
except SyntaxError:
return content

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
]
dependencies = [
'sphinx',
'minify-html-onepass',
'minify-html',
'jsmin',
'cssmin',
'jinja2',
Expand Down

0 comments on commit 6400131

Please sign in to comment.