mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix bug 2587: Only add \n's to head if they are not alreay present.
This commit is contained in:
parent
7999b3c188
commit
fb92bbbf50
@ -21,7 +21,9 @@ _span_pat = re.compile('<span.*?</span>', re.DOTALL|re.IGNORECASE)
|
|||||||
def sanitize_head(match):
|
def sanitize_head(match):
|
||||||
x = match.group(1)
|
x = match.group(1)
|
||||||
x = _span_pat.sub('', x)
|
x = _span_pat.sub('', x)
|
||||||
return '<head>\n'+x+'\n</head>'
|
x = ('\n%s' % x) if not x.startswith('\n') else x
|
||||||
|
x += '\n' if not x.endswith('\n') else ''
|
||||||
|
return '<head>%s</head>' % x
|
||||||
|
|
||||||
def chap_head(match):
|
def chap_head(match):
|
||||||
chap = match.group('chap')
|
chap = match.group('chap')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user