Fixed search. Changes stylesheet name, so changes can propagate faster.
[redakcja.git] / platforma / static / js / xslt.js
index 6cc545a..566b0a8 100644 (file)
@@ -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';                                   
                                };