X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/594998281db97c722685e9e8ed5759d4e5b2ded0..58d4aaf62aad7d19d2fb26176afd083c8f75f82a:/redakcja/static/js/wiki/xslt.js?ds=sidebyside diff --git a/redakcja/static/js/wiki/xslt.js b/redakcja/static/js/wiki/xslt.js index 86c6d362..67216eb9 100644 --- a/redakcja/static/js/wiki/xslt.js +++ b/redakcja/static/js/wiki/xslt.js @@ -58,10 +58,9 @@ function withThemes(code_block, onError) } - function xml2html(options) { withStylesheets(function() { - var xml = options.xml.replace(/\/\s+/g, '
'); + var xml = options.xml.replace(/\/(\s+)/g, '
$1'); var parser = new DOMParser(); var serializer = new XMLSerializer(); var doc = parser.parseFromString(xml, 'text/xml'); @@ -80,7 +79,10 @@ function xml2html(options) { } if (error.length > 0 && options.error) { - options.error(error.text()); + source = $('sourcetext', doc); + source_text = source.text(); + source.text(''); + options.error(error.text(), source_text); } else { options.success(doc.firstChild);