diff --git a/content.py b/content.py index 19bf21921..0bd5bca2c 100644 --- a/content.py +++ b/content.py @@ -36,9 +36,9 @@ def htmlReplaceQuoteMarks(content: str) -> str: markup = False elif ch == '"' and not markup: if openQuote: - currChar = '' + currChar = '“' else: - currChar = '' + currChar = '”' openQuote = not openQuote newContent += currChar return newContent @@ -639,7 +639,7 @@ def addHtmlTags(baseDir: str, httpPrefix: str, if longWordsList: content = removeLongWords(content, maxWordLength, longWordsList) content = content.replace(' --linebreak-- ', '

') - return '

' + content + '

' + return '

' + htmlReplaceQuoteMarks(content) + '

' def getMentionsFromHtml(htmlText: str, diff --git a/tests.py b/tests.py index 5f0e0857e..68dbaaad6 100644 --- a/tests.py +++ b/tests.py @@ -1928,7 +1928,7 @@ def runHtmlReplaceQuoteMarks(): print('htmlReplaceQuoteMarks') testStr = 'The "cat" "sat" on the mat' result = htmlReplaceQuoteMarks(testStr) - assert result == 'The cat sat on the mat' + assert result == 'The “cat” “sat” on the mat' testStr = 'The cat sat on the mat' result = htmlReplaceQuoteMarks(testStr) @@ -1936,11 +1936,11 @@ def runHtmlReplaceQuoteMarks(): testStr = '"hello"' result = htmlReplaceQuoteMarks(testStr) - assert result == 'hello' + assert result == '“hello”' testStr = '"hello" test html' result = htmlReplaceQuoteMarks(testStr) - assert result == 'hello test html' + assert result == '“hello” test html' def runAllTests():