From: Radek Czajka Date: Tue, 24 May 2011 10:58:48 +0000 (+0200) Subject: #1508: don't choke on comments before root X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/0300c67b09d2d26318a8df1f8c5a92d1b2589db1?ds=sidebyside;hp=af0693ddb5e4f6240d273c8a66fd1e6ef2a52872 #1508: don't choke on comments before root --- 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) {