mirror of https://gitlab.com/bashrc2/epicyon
Fixed separator
parent
83386fd2a3
commit
90197046b3
|
@ -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= \
|
||||||
|
|
Loading…
Reference in New Issue