#1508: don't choke on comments before root
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 24 May 2011 10:58:48 +0000 (12:58 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 24 May 2011 10:58:48 +0000 (12:58 +0200)
redakcja/static/js/wiki/view_editor_wysiwyg.js
redakcja/static/js/wiki/xslt.js

index a3f4278..0179f40 100644 (file)
             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);
index ce7614d..46726c1 100644 (file)
@@ -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) {