mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
TXT Input: Fix self closed title tags being generated
This commit is contained in:
parent
4b9d1e40fc
commit
08c840cba3
@ -16,7 +16,7 @@ from calibre.ebooks.metadata.opf2 import OPFCreator
|
||||
from calibre.ebooks.conversion.preprocess import DocAnalysis
|
||||
from calibre.utils.cleantext import clean_ascii_chars
|
||||
|
||||
HTML_TEMPLATE = u'<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>%s</title></head><body>\n%s\n</body></html>'
|
||||
HTML_TEMPLATE = u'<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>%s </title></head><body>\n%s\n</body></html>'
|
||||
|
||||
def clean_txt(txt):
|
||||
'''
|
||||
@ -28,7 +28,7 @@ def clean_txt(txt):
|
||||
# Strip whitespace from the end of the line. Also replace
|
||||
# all line breaks with \n.
|
||||
txt = '\n'.join([line.rstrip() for line in txt.splitlines()])
|
||||
|
||||
|
||||
# Replace whitespace at the beginning of the line with
|
||||
txt = re.sub('(?m)(?<=^)([ ]{2,}|\t+)(?=.)', ' ' * 4, txt)
|
||||
|
||||
@ -75,7 +75,7 @@ def convert_basic(txt, title='', epub_split_size_kb=0):
|
||||
'''
|
||||
Converts plain text to html by putting all paragraphs in
|
||||
<p> tags. It condense and retains blank lines when necessary.
|
||||
|
||||
|
||||
Requires paragraphs to be in single line format.
|
||||
'''
|
||||
txt = clean_txt(txt)
|
||||
@ -215,7 +215,7 @@ def detect_paragraph_type(txt):
|
||||
def detect_formatting_type(txt):
|
||||
'''
|
||||
Tries to determine the formatting of the document.
|
||||
|
||||
|
||||
markdown: Markdown formatting is used.
|
||||
textile: Textile formatting is used.
|
||||
heuristic: When none of the above formatting types are
|
||||
|
Loading…
x
Reference in New Issue
Block a user