Skip to content

Commit

Permalink
fix: MDict with wrong compact HTML rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Crissium committed Feb 16, 2024
1 parent 2473848 commit ca4d1e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/app/dicts/mdict/html_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ def _expand_compact_html(self, compact_html: str) -> str:
buf.append(self._compact_html_rules[m.group(1)][0])
last_end_tag = self._compact_html_rules[m.group(1)][1]
pos = m.end()
buf.append(last_end_tag)
return ''.join(buf)
if len(buf) > 0:
buf.append(last_end_tag)
return ''.join(buf)
else:
return compact_html

def _fix_file_path(self, definition_html: str, file_extension: str) -> str:
extension_position = 0
Expand Down

0 comments on commit ca4d1e1

Please sign in to comment.