Skip to content

Commit

Permalink
Fix some wrong bold cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
un-pogaz committed Feb 10, 2024
1 parent 5993eb7 commit d2b7303
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ActionCommentsCleaner(InterfaceActionBase):
description = _('Remove the scraps CSS in HTML comments')
supported_platforms = ['windows', 'osx', 'linux']
author = 'un_pogaz'
version = (1, 12, 1)
version = (1, 12, 2)
minimum_calibre_version = (5, 0, 0)

#: This field defines the GUI plugin class that contains all the code
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog - Comments Cleaner

## [1.12.2] - 2024/02/10

### Bug fixes
- Fix some wrong bold cleaning

## [1.12.1] - 2024/01/27

### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions comments_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,9 @@ def clean_style(text: str, PREFS: Optional[dict]=None) -> str:
text = text.replace(m.group(0), rpl)

if PREFS[KEY.FONT_WEIGHT] == 'bold':
text = regex.loop(r' style="([^"]*) font-weight: [5-9]\d\d;([^"]*)"', r' style="\1 font-weight: xxx;\2"', text)
text = regex.loop(r' style="([^"]*) font-weight: [6-9]\d\d;([^"]*)"', r' style="\1 font-weight: xxx;\2"', text)
text = regex.loop(r' style="([^"]*) font-weight: [1-5]\d\d;([^"]*)"', r' style="\1\2"', text)
text = regex.loop(r' style="([^"]*) font-weight: xxx;([^"]*)"', r' style="\1 '+FONT_WEIGHT+r';\2"', text)
text = regex.loop(r' style="([^"]*) font-weight: [1-4]\d\d;([^"]*)"', r' style="\1\2"', text)

elif PREFS[KEY.FONT_WEIGHT] == 'del':
text = regex.loop(r'<(/?)strong(| [^>]*)>', r'<\1span\2>', text)
Expand Down

0 comments on commit d2b7303

Please sign in to comment.