Fixed separator

main2
Bob Mottram 2019-11-04 20:57:41 +00:00
parent 83386fd2a3
commit 90197046b3
1 changed files with 1 additions and 3 deletions

View File

@ -240,10 +240,8 @@ def removeLongWords(content: str,maxWordLength: int,longWordsList: []) -> str:
"""Breaks up long words so that on mobile screens this doesn't disrupt the layout """Breaks up long words so that on mobile screens this doesn't disrupt the layout
""" """
words=content.split(' ') words=content.split(' ')
separator='\n'
if not longWordsList: if not longWordsList:
longWordsList=[] longWordsList=[]
separator='<br>'
for wordStr in words: for wordStr in words:
if len(wordStr)>maxWordLength: if len(wordStr)>maxWordLength:
if wordStr not in longWordsList: if wordStr not in longWordsList:
@ -266,7 +264,7 @@ def removeLongWords(content: str,maxWordLength: int,longWordsList: []) -> str:
if len(wordStr[maxWordLength:])<maxWordLength: if len(wordStr[maxWordLength:])<maxWordLength:
content= \ content= \
content.replace(wordStr, \ content.replace(wordStr, \
wordStr[:maxWordLength]+separator+ \ wordStr[:maxWordLength]+'\n'+ \
wordStr[maxWordLength:]) wordStr[maxWordLength:])
else: else:
content= \ content= \