From 0300c67b09d2d26318a8df1f8c5a92d1b2589db1 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 24 May 2011 12:58:48 +0200 Subject: [PATCH 1/1] #1508: don't choke on comments before root --- redakcja/static/js/wiki/view_editor_wysiwyg.js | 3 ++- redakcja/static/js/wiki/xslt.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/redakcja/static/js/wiki/view_editor_wysiwyg.js b/redakcja/static/js/wiki/view_editor_wysiwyg.js index a3f42786..0179f408 100644 --- a/redakcja/static/js/wiki/view_editor_wysiwyg.js +++ b/redakcja/static/js/wiki/view_editor_wysiwyg.js @@ -637,7 +637,8 @@ return _finalize(failure); html2text({ - element: $('#html-view div').get(0), + element: $('#html-view').get(0), + stripOuter: true, success: function(text){ self.doc.setText(text); _finalize(success); diff --git a/redakcja/static/js/wiki/xslt.js b/redakcja/static/js/wiki/xslt.js index ce7614df..46726c18 100644 --- a/redakcja/static/js/wiki/xslt.js +++ b/redakcja/static/js/wiki/xslt.js @@ -85,7 +85,7 @@ function xml2html(options) { source.text(''); options.error(error.text(), source_text); } else { - options.success(doc.firstChild); + options.success(doc.childNodes); withThemes(function(canonThemes) { if (canonThemes != null) { -- 2.20.1