diff --git a/scripts/ebook/step_6.py b/scripts/ebook/step_6.py index cdbc412b4..5f4a501db 100755 --- a/scripts/ebook/step_6.py +++ b/scripts/ebook/step_6.py @@ -141,9 +141,10 @@ def fix_ellipsis(s: str) -> str: # converting "color-marked" styles of 1.sh back to proper style classes cont = re.sub( - r'<(div|span) style="color: (parsel|writtenNote|McGonagallWhiteBoard|headline)"', # noqa: E501 + r'<(div|span)\s+style="color:\s*(parsel|writtenNote|McGonagallWhiteBoard|headline)"', r'<\1 class="\2"', cont, + flags=re.DOTALL, ) # add css style file format for \emph in \emph