Webclient: don't strip single leading space
This commit is contained in:
parent
92ec6a5ae8
commit
677fe306cb
1 changed files with 2 additions and 2 deletions
|
|
@ -93,7 +93,7 @@ class TextToHTMLparser(object):
|
||||||
re_uline = re.compile("(?:%s)(.*?)(?=%s|%s)" % (underline.replace("[", r"\["), fgstop, bgstop))
|
re_uline = re.compile("(?:%s)(.*?)(?=%s|%s)" % (underline.replace("[", r"\["), fgstop, bgstop))
|
||||||
re_blink = re.compile("(?:%s)(.*?)(?=%s|%s)" % (blink.replace("[", r"\["), fgstop, bgstop))
|
re_blink = re.compile("(?:%s)(.*?)(?=%s|%s)" % (blink.replace("[", r"\["), fgstop, bgstop))
|
||||||
re_inverse = re.compile("(?:%s)(.*?)(?=%s|%s)" % (inverse.replace("[", r"\["), fgstop, bgstop))
|
re_inverse = re.compile("(?:%s)(.*?)(?=%s|%s)" % (inverse.replace("[", r"\["), fgstop, bgstop))
|
||||||
re_string = re.compile(r'(?P<htmlchars>[<&>])|(?P<space> [ \t]+)|(?P<lineend>\r\n|\r|\n)', re.S|re.M|re.I)
|
re_string = re.compile(r'(?P<htmlchars>[<&>])|(?P<space> [ \t]+)|(?P<spacestart>^ )|(?P<lineend>\r\n|\r|\n)', re.S|re.M|re.I)
|
||||||
re_url = re.compile(r'((?:ftp|www|https?)\W+(?:(?!\.(?:\s|$)|&\w+;)[^"\',;$*^\\(){}<>\[\]\s])+)(\.(?:\s|$)|&\w+;|)')
|
re_url = re.compile(r'((?:ftp|www|https?)\W+(?:(?!\.(?:\s|$)|&\w+;)[^"\',;$*^\\(){}<>\[\]\s])+)(\.(?:\s|$)|&\w+;|)')
|
||||||
re_mxplink = re.compile(r'\|lc(.*?)\|lt(.*?)\|le', re.DOTALL)
|
re_mxplink = re.compile(r'\|lc(.*?)\|lt(.*?)\|le', re.DOTALL)
|
||||||
|
|
||||||
|
|
@ -269,7 +269,7 @@ class TextToHTMLparser(object):
|
||||||
return '<br>'
|
return '<br>'
|
||||||
elif cdict['space'] == '\t':
|
elif cdict['space'] == '\t':
|
||||||
return ' ' * self.tabstop
|
return ' ' * self.tabstop
|
||||||
elif cdict['space']:
|
elif cdict['space'] or cdict["spacestart"]:
|
||||||
text = match.group().replace('\t', ' ' * self.tabstop)
|
text = match.group().replace('\t', ' ' * self.tabstop)
|
||||||
text = text.replace(' ', ' ')
|
text = text.replace(' ', ' ')
|
||||||
return text
|
return text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue