No suffix

main2
Bob Mottram 2019-11-04 20:45:10 +00:00
parent ed2e97ab55
commit ba5608c705
2 changed files with 3 additions and 5 deletions

View File

@ -257,9 +257,7 @@ def removeLongWords(content: str,maxWordLength: int,longWordsList: []) -> str:
continue
elif 'dat:' in wordStr:
continue
suffix=''
if '<' in wordStr:
suffix='<'+wordStr.split('<',1)[1]
wordStr=wordStr.split('<',1)[0]
if '/' in wordStr:
continue
@ -267,11 +265,11 @@ def removeLongWords(content: str,maxWordLength: int,longWordsList: []) -> str:
content= \
content.replace(wordStr, \
wordStr[:maxWordLength]+separator+ \
wordStr[maxWordLength:]+suffix)
wordStr[maxWordLength:])
else:
content= \
content.replace(wordStr, \
wordStr[:maxWordLength]+suffix)
wordStr[:maxWordLength])
return content
def addHtmlTags(baseDir: str,httpPrefix: str, \

View File

@ -1531,7 +1531,7 @@ def testWebLinks():
assert 'ellipsis' in linkedText
exampleText='<p>1. HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAH</p>'
resultText=removeLongWords(exampleText,40,[])
assert resultText=='<p>1. HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA</p></p>'
assert resultText=='<p>1. HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA</p>'
def testAddEmoji():
print('testAddEmoji')