X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a11cf903969595b065b46cc991d70c43035af76d..0fd55a38c4873d5916a3553d7510b9308f4eee6d:/platforma/static/js/xslt.js diff --git a/platforma/static/js/xslt.js b/platforma/static/js/xslt.js index 6cc545a5..566b0a80 100644 --- a/platforma/static/js/xslt.js +++ b/platforma/static/js/xslt.js @@ -124,10 +124,10 @@ const PADDING = { lista_osoba: 1, "podpis": 1, - "wers": 1, - "wers_cd": 1, - "wers_akap": 1, - "wers_wciety": 1, + "wers": 0, + "wers_cd": 0, + "wers_akap": 0, + "wers_wciety": 0, "rdf:RDF": 3, "rdf:Description": 1, @@ -182,12 +182,11 @@ HTMLSerializer.prototype._pushTagEnd = function(tagName) { HTMLSerializer.prototype._verseBefore = function(node) { var prev = node.previousSibling; - while(prev) { - if(prev.nodeType == ELEMENT_NODE && prev.hasAttribute('x-verse')) - return true; - } - - return false; + while((prev !== null) && (prev.nodeType != ELEMENT_NODE)) { + prev = prev.previousSibling; + } + + return (prev !== null) && prev.hasAttribute('x-verse'); } HTMLSerializer.prototype.serialize = function(rootElement, stripOuter) @@ -237,6 +236,11 @@ HTMLSerializer.prototype.serialize = function(rootElement, stripOuter) break; }; + if(xnode === 'out-of-flow-text') { + self._pushChildren(token.node); + break; + } + if(token.node.hasAttribute('x-verse') && self._verseBefore(token.node)) { self.result += '/\n'; };