diff --git a/content.py b/content.py
index bf82ce03f..56a768921 100644
--- a/content.py
+++ b/content.py
@@ -27,17 +27,20 @@ def htmlReplaceQuoteMarks(content: str) -> str:
newContent = ''
openQuote = True
- noOfSections = len(sections)
- ctr = 0
- for s in sections:
- newContent += s
- if ctr < noOfSections - 1:
+ markup = False
+ for ch in content:
+ currChar = ch
+ if ch == '<':
+ markup = True
+ elif ch == '>':
+ markup = False
+ elif ch == '"' and not markup:
if openQuote:
- newContent += ''
+ currChar = ''
else:
- newContent += '
'
+ currChar = '
'
openQuote = not openQuote
- ctr += 1
+ newContent += currChar
return newContent
diff --git a/tests.py b/tests.py
index e1038c347..5f0e0857e 100644
--- a/tests.py
+++ b/tests.py
@@ -1938,6 +1938,10 @@ def runHtmlReplaceQuoteMarks():
result = htmlReplaceQuoteMarks(testStr)
assert result == 'hello
'
+ testStr = '"hello" test html'
+ result = htmlReplaceQuoteMarks(testStr)
+ assert result == 'hello
test html'
+
def runAllTests():
print('Running tests...')