metanorma-iho 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f59fa1d88c28618f561a66eee85bc5fb48166320fa81fed3020cffbafd1529e
4
- data.tar.gz: 41e732c59a3d41dff8cda5472bf5f964e1d87db77d2de7ac28456507612bc0a5
3
+ metadata.gz: 3e45ecf864f0b42669794eec9b18c1ae434315fa26884f8f50845ab24a4ccc6e
4
+ data.tar.gz: a232f5193d979b9cba430bf07b90475c230a7c6732064363d153bc9d89514b34
5
5
  SHA512:
6
- metadata.gz: 45ef94d96f96ed9a96ecca833df2d794177df2fe40756bdeeab7d19cc994a7b120c8449293c26f9f193b5926b1add31b8404ea2d6bd161bf05d383ac9ce5029d
7
- data.tar.gz: 2edea68d3449e0177f412e26b3ff99f83ed97b1eb8dcd8a9bc9a14fb71697e09742200724e229292633122bbf99415b3b99a738030d754b6cc8776d4dc2825f0
6
+ metadata.gz: 8e42bdf9cc060ab2e68e80bc33e61c697e98ffc931552a603153e843fda40e4e6d43abecddec2baa9b59708a0ea487ddbc90df5063f523d8c07f0b77ad096b46
7
+ data.tar.gz: 2fbddcf7e8a77d87201792d70f258d866c4c409f6217b10f1ff94803e886f03a5d341af41c3f63a2fa15408f63f9acf0763eb82212e28649ae19596a9323e59d
@@ -2157,8 +2157,27 @@
2157
2157
  <xsl:sort select="@displayorder" data-type="number"/>
2158
2158
  <xsl:apply-templates select="."/>
2159
2159
  </xsl:for-each>
2160
- </xsl:template><xsl:template match="text()">
2161
- <xsl:value-of select="."/>
2160
+ </xsl:template><xsl:variable name="tag_open">###fo:inline###</xsl:variable><xsl:variable name="tag_close">###/fo:inline###</xsl:variable><xsl:template match="text()" name="text">
2161
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2162
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_open,'$1',$tag_close))"/>
2163
+ <xsl:call-template name="replace_fo_inline">
2164
+ <xsl:with-param name="text" select="$text"/>
2165
+ </xsl:call-template>
2166
+ </xsl:template><xsl:template name="replace_fo_inline">
2167
+ <xsl:param name="text"/>
2168
+ <xsl:choose>
2169
+ <xsl:when test="contains($text, $tag_open)">
2170
+ <xsl:value-of select="substring-before($text, $tag_open)"/>
2171
+ <xsl:text disable-output-escaping="yes">&lt;fo:inline keep-together.within-line="always"&gt;</xsl:text>
2172
+ <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
2173
+ <xsl:value-of select="substring-before($text_after, $tag_close)"/>
2174
+ <xsl:text disable-output-escaping="yes">&lt;/fo:inline&gt;</xsl:text>
2175
+ <xsl:call-template name="replace_fo_inline">
2176
+ <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
2177
+ </xsl:call-template>
2178
+ </xsl:when>
2179
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
2180
+ </xsl:choose>
2162
2181
  </xsl:template><xsl:template match="*[local-name()='br']">
2163
2182
  <xsl:value-of select="$linebreak"/>
2164
2183
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
@@ -5781,7 +5800,8 @@
5781
5800
  <fo:inline><xsl:apply-templates/></fo:inline>
5782
5801
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
5783
5802
  <xsl:if test="normalize-space() != ''">
5784
- <xsl:value-of select="."/>
5803
+ <!-- <xsl:value-of select="."/> -->
5804
+ <xsl:call-template name="text"/>
5785
5805
  </xsl:if>
5786
5806
  </xsl:template><xsl:template match="*[local-name() = 'quote']">
5787
5807
  <fo:block-container margin-left="0mm">
@@ -2157,8 +2157,27 @@
2157
2157
  <xsl:sort select="@displayorder" data-type="number"/>
2158
2158
  <xsl:apply-templates select="."/>
2159
2159
  </xsl:for-each>
2160
- </xsl:template><xsl:template match="text()">
2161
- <xsl:value-of select="."/>
2160
+ </xsl:template><xsl:variable name="tag_open">###fo:inline###</xsl:variable><xsl:variable name="tag_close">###/fo:inline###</xsl:variable><xsl:template match="text()" name="text">
2161
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2162
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_open,'$1',$tag_close))"/>
2163
+ <xsl:call-template name="replace_fo_inline">
2164
+ <xsl:with-param name="text" select="$text"/>
2165
+ </xsl:call-template>
2166
+ </xsl:template><xsl:template name="replace_fo_inline">
2167
+ <xsl:param name="text"/>
2168
+ <xsl:choose>
2169
+ <xsl:when test="contains($text, $tag_open)">
2170
+ <xsl:value-of select="substring-before($text, $tag_open)"/>
2171
+ <xsl:text disable-output-escaping="yes">&lt;fo:inline keep-together.within-line="always"&gt;</xsl:text>
2172
+ <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
2173
+ <xsl:value-of select="substring-before($text_after, $tag_close)"/>
2174
+ <xsl:text disable-output-escaping="yes">&lt;/fo:inline&gt;</xsl:text>
2175
+ <xsl:call-template name="replace_fo_inline">
2176
+ <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
2177
+ </xsl:call-template>
2178
+ </xsl:when>
2179
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
2180
+ </xsl:choose>
2162
2181
  </xsl:template><xsl:template match="*[local-name()='br']">
2163
2182
  <xsl:value-of select="$linebreak"/>
2164
2183
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
@@ -5781,7 +5800,8 @@
5781
5800
  <fo:inline><xsl:apply-templates/></fo:inline>
5782
5801
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
5783
5802
  <xsl:if test="normalize-space() != ''">
5784
- <xsl:value-of select="."/>
5803
+ <!-- <xsl:value-of select="."/> -->
5804
+ <xsl:call-template name="text"/>
5785
5805
  </xsl:if>
5786
5806
  </xsl:template><xsl:template match="*[local-name() = 'quote']">
5787
5807
  <fo:block-container margin-left="0mm">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.5.6".freeze
3
+ VERSION = "0.5.7".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-21 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities