Support for <wers>.
authorRadek Czajka <rczajka@rczajka.pl>
Sun, 22 Mar 2020 09:39:19 +0000 (10:39 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Sun, 22 Mar 2020 09:39:19 +0000 (10:39 +0100)
requirements/requirements.txt
src/redakcja/static/js/wiki/xslt.js
src/redakcja/static/xsl/wl2html_client.xsl

index c90865e..00f7f0a 100644 (file)
@@ -8,7 +8,7 @@ oauth2
 httplib2 # oauth2 dependency
 python-slugify
 
-librarian==1.7.6
+librarian==1.8.1
 
 ## Django
 Django==2.2.6
index 43db29b..1c69352 100644 (file)
@@ -17,7 +17,7 @@ function withStylesheets(code_block, onError)
     if (!xml2htmlStylesheet) {
        $.blockUI({message: 'Ładowanie arkuszy stylów...'});
        $.ajax({
-               url: STATIC_URL + 'xsl/wl2html_client.xsl?20171106',
+               url: STATIC_URL + 'xsl/wl2html_client.xsl?2019121801',
                dataType: 'xml',
                timeout: 10000,
                success: function(data) {
@@ -157,7 +157,7 @@ HTMLSerializer.prototype._verseBefore = function(node) {
 }
 
 HTMLSerializer.prototype._nodeIgnored = function(node) {
-    return node.getAttribute('x-node') == 'wers';
+    return node.getAttribute('x-auto-node') == 'true';
 }
 
 HTMLSerializer.prototype._ignoredWithWhitespace = function(node) {
index 784acb7..f5a442b 100644 (file)
         <!-- Possible variants: -->
         <xsl:choose>
             <!-- Simple verse == not wers_ tags anywhere until the ending br -->
-            <xsl:when test="not($verse-content[starts-with(name(), 'wers_')])">
-                <p class="wers" x-node="wers" x-verse="true">
+            <xsl:when test="not($verse-content[starts-with(name(), 'wers')])">
+                <p class="wers" x-node="wers" x-verse="true" x-auto-node="true">
                 <xsl:apply-templates select="$verse-content[local-name(.) != 'br']">
                     <xsl:with-param name="mixed" select="true()" />
                 </xsl:apply-templates>
         </xsl:choose>
     </xsl:template>
 
-    <xsl:template match="wers_cd|wers_akap|wers_wciety|wers_do_prawej">
+    <xsl:template match="wers_cd|wers_akap|wers_wciety|wers_do_prawej|wers">
         <xsl:param name="mixed" />
                <!-- <xsl:choose>
                <xsl:when test="ancestor::*[0]/self::strofa"> -->