mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix tails being prepended instead of appended to child content
This commit is contained in:
parent
3e8d9492a8
commit
394726bca3
@ -273,11 +273,14 @@ def text_from_serialized_html(data):
|
|||||||
ignore_text = {'script':True, 'style':True}
|
ignore_text = {'script':True, 'style':True}
|
||||||
while stack.length:
|
while stack.length:
|
||||||
node = stack.pop()
|
node = stack.pop()
|
||||||
|
if jstype(node) is 'string':
|
||||||
|
ans.push(node)
|
||||||
|
continue
|
||||||
src = tag_map[node[0]]
|
src = tag_map[node[0]]
|
||||||
if not ignore_text[src.n] and src.x:
|
if not ignore_text[src.n] and src.x:
|
||||||
ans.push(src.x)
|
ans.push(src.x)
|
||||||
if src.l:
|
if src.l:
|
||||||
ans.push(src.l)
|
stack.push(src.l)
|
||||||
for v'var i = node.length - 1; i >= 1; i--':
|
for v'var i = node.length - 1; i >= 1; i--':
|
||||||
stack.push(node[i])
|
stack.push(node[i])
|
||||||
return ans.join('')
|
return ans.join('')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user