From db6059ca00f4bb7fa9ae1f04b0c3efe6c2f2d05b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 5 Jan 2012 19:32:03 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/oeb/display/cfi.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/oeb/display/cfi.coffee b/src/calibre/ebooks/oeb/display/cfi.coffee index 5020174664..1bb2533485 100644 --- a/src/calibre/ebooks/oeb/display/cfi.coffee +++ b/src/calibre/ebooks/oeb/display/cfi.coffee @@ -474,10 +474,10 @@ class CanonicalFragmentIdentifier x = (point.a*rect.left + (1-point.a)*rect.right) y = (rect.top + rect.bottom)/2 [x, y] = viewport_to_document(x, y, ndoc) - tn = if span.firstChild then span.firstChild.nodeValue else '' - tn = ndoc.createTextNode(tn) p = span.parentNode - p.insertBefore(tn, span) + for node in span.childNodes + span.removeChild(node) + p.insertBefore(node, span) p.removeChild(span) p.normalize() if callback