mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
wrap pure whitespace
This commit is contained in:
parent
ee44d2ccd4
commit
4ff64c0b21
@ -164,7 +164,7 @@ def add_kobo_spans(inner, root_lang):
|
||||
paranum += 1
|
||||
segnum = 0
|
||||
increment_next_para = False
|
||||
stripped = leading_whitespace_pat.sub('', text)
|
||||
stripped = leading_whitespace_pat.sub('', text) or text
|
||||
ws = None
|
||||
if num := len(text) - len(stripped):
|
||||
ws = text[:num]
|
||||
|
@ -59,6 +59,9 @@ div#book-inner {{ margin-top: 0; margin-bottom: 0; }}</style><script type="text/
|
||||
suffix = '</div></div></body></html>'
|
||||
for src, expected in {
|
||||
# basics
|
||||
'<p>one</p><p>\xa0</p>':
|
||||
'<p><span class="koboSpan" id="kobo.1.1">one</span></p><p><span class="koboSpan" id="kobo.2.1"> </span></p>',
|
||||
|
||||
'<p>Simple sentences. In a single paragraph.'
|
||||
'<p>A sentence <i>with <b>nested</b>, tailed</i> formatting. Another.':
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user