main
Bob Mottram 2020-09-30 23:55:53 +01:00
parent 463192242f
commit 3fe7a8c498
2 changed files with 7 additions and 1 deletions

View File

@ -13,6 +13,7 @@ from utils import loadJson
from utils import fileLastModified
from utils import getLinkPrefixes
def removeQuotesWithinQuotes(content: str) -> str:
"""Removes any blockquote inside blockquote
"""

View File

@ -2146,7 +2146,12 @@ def testReplaceEmailQuote():
"&gt; Text2<br />&gt; <br />&gt; Text3<br />" + \
"&gt;<br />&gt; Text4<br />&gt; <br />&gt; " + \
"Text5<br />&gt; <br />&gt; Text6</p><p>Text7</p>"
expectedStr = "<p><span class=\"h-card\"><a href=\"https://somedomain/@somenick\" class=\"u-url mention\">@<span>somenick</span></a></span> </p><p><blockquote> Text1.<br /><br />Text2<br /><br />Text3<br />&gt;<br />Text4<br /><br />Text5<br /><br />Text6</blockquote></p><p>Text7</p>"
expectedStr = "<p><span class=\"h-card\">" + \
"<a href=\"https://somedomain/@somenick\" " + \
"class=\"u-url mention\">@<span>somenick</span></a>" + \
"</span> </p><p><blockquote> Text1.<br /><br />" + \
"Text2<br /><br />Text3<br />&gt;<br />Text4<br />" + \
"<br />Text5<br /><br />Text6</blockquote></p><p>Text7</p>"
resultStr = htmlReplaceEmailQuote(testStr)
if resultStr != expectedStr:
print('Result: ' + str(resultStr))