diff --git a/markdown_it/common/utils.py b/markdown_it/common/utils.py index ac99dbc8..17337c35 100644 --- a/markdown_it/common/utils.py +++ b/markdown_it/common/utils.py @@ -272,7 +272,7 @@ def isPunctChar(ch): } -def isMdAsciiPunct(ch: str): +def isMdAsciiPunct(ch: int): """Markdown ASCII punctuation characters. :: diff --git a/markdown_it/rules_core/smartquotes.py b/markdown_it/rules_core/smartquotes.py index cceb1778..65e39487 100644 --- a/markdown_it/rules_core/smartquotes.py +++ b/markdown_it/rules_core/smartquotes.py @@ -94,12 +94,8 @@ def process_inlines(tokens: List[Token], state: StateCore): nextChar = charCodeAt(tokens[j].content, 0) break - isLastPunctChar = isMdAsciiPunct(chr(lastChar)) or isPunctChar( - chr(lastChar) - ) - isNextPunctChar = isMdAsciiPunct(chr(nextChar)) or isPunctChar( - chr(nextChar) - ) + isLastPunctChar = isMdAsciiPunct(lastChar) or isPunctChar(chr(lastChar)) + isNextPunctChar = isMdAsciiPunct(nextChar) or isPunctChar(chr(nextChar)) isLastWhiteSpace = isWhiteSpace(lastChar) isNextWhiteSpace = isWhiteSpace(nextChar)