From 394726bca3d025e828e7e9b33be5067e1b2863d9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 15 Jan 2017 00:34:09 +0530 Subject: [PATCH] Fix tails being prepended instead of appended to child content --- src/pyj/read_book/resources.pyj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/resources.pyj b/src/pyj/read_book/resources.pyj index d920be72a6..caf37582f1 100644 --- a/src/pyj/read_book/resources.pyj +++ b/src/pyj/read_book/resources.pyj @@ -273,11 +273,14 @@ def text_from_serialized_html(data): ignore_text = {'script':True, 'style':True} while stack.length: node = stack.pop() + if jstype(node) is 'string': + ans.push(node) + continue src = tag_map[node[0]] if not ignore_text[src.n] and src.x: ans.push(src.x) if src.l: - ans.push(src.l) + stack.push(src.l) for v'var i = node.length - 1; i >= 1; i--': stack.push(node[i]) return ans.join('')