metanorma-iec 2.0.5 → 2.0.6

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: 4d7748699d6414de9def85acc9298a31f507492ca7a1fb5bc94b19264fdbbbba
4
- data.tar.gz: 342bcbd3c66cd744bd8c1a63f4a2867f6cb024c504ce9b4a45e90b0d1d50ba8c
3
+ metadata.gz: 853d28e406c62d6a579dd28f8cb61c8e94dc133441a98fd7c0bb77a76452387b
4
+ data.tar.gz: 7114e1a86ee395f61c13a0f05a1813068da20bda5ca3f402fb91302969a31967
5
5
  SHA512:
6
- metadata.gz: 583090be4e32cfcb95eed3071775b35959703175e3821623a43c5e46c3e279d2b7519e7e5367513759f4765298a7edbe32d4efbf7d05ff1d9d8e7e880c925381
7
- data.tar.gz: ccbeaecab184817d9e92d5767e7ce2ed6b53d7dfb3745048570489747cf986f16abdf6607672cf66d57c2702d3234bd321ae5022f9725986754d2f52e514fa3a
6
+ metadata.gz: a9068350394bd65e4b2593a50ad7a367ba5e55cb1b9a63a60a9a627850052a75a2f57c61199f19cc32667574fca04c163b05d1122fcf07dfd55fb2d8c72a746f
7
+ data.tar.gz: abe4a8a6c92df9930eb7be164f93a7fe44dc176b274a7fa06c38a71e22c81016d7a0eae5e71d16be7a1f2c49d5bf99112cfcf0c7e9a3f9f77017ab466280f6bc
@@ -1922,7 +1922,7 @@
1922
1922
  </xsl:copy>
1923
1923
  </xsl:template> -->
1924
1924
 
1925
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:key name="bibitems" match="*[local-name() = 'bibitem']" use="@id"/><xsl:key name="bibitems_hidden" match="*[local-name() = 'bibitem'][@hidden='true'] | *[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']" use="@id"/><xsl:variable name="lang">
1925
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
1926
1926
  <xsl:call-template name="getLang"/>
1927
1927
  </xsl:variable><xsl:variable name="pageWidth_">
1928
1928
  210
@@ -6515,7 +6515,51 @@
6515
6515
  <xsl:with-param name="text" select="$text_step1"/>
6516
6516
  </xsl:call-template>
6517
6517
  </xsl:variable>
6518
- <xsl:value-of select="$text_step2"/>
6518
+
6519
+ <!-- <xsl:value-of select="$text_step2"/> -->
6520
+
6521
+ <!-- add zero-width space after space -->
6522
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
6523
+
6524
+ <!-- split text by zero-width space -->
6525
+ <xsl:variable name="text_step4">
6526
+ <xsl:call-template name="split">
6527
+ <xsl:with-param name="pText" select="$text_step3"/>
6528
+ <xsl:with-param name="sep" select="$zero_width_space"/>
6529
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
6530
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
6531
+ </xsl:call-template>
6532
+ </xsl:variable>
6533
+
6534
+ <xsl:for-each select="xalan:nodeset($text_step4)/item">
6535
+ <xsl:choose>
6536
+ <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6537
+ <xsl:call-template name="interspers">
6538
+ <xsl:with-param name="str" select="."/>
6539
+ </xsl:call-template>
6540
+ </xsl:when>
6541
+ <xsl:otherwise>
6542
+ <xsl:value-of select="."/>
6543
+ </xsl:otherwise>
6544
+ </xsl:choose>
6545
+ </xsl:for-each>
6546
+
6547
+ </xsl:template><xsl:template name="interspers">
6548
+ <xsl:param name="str"/>
6549
+ <xsl:param name="char" select="$zero_width_space"/>
6550
+ <xsl:if test="$str != ''">
6551
+ <xsl:value-of select="substring($str, 1, 1)"/>
6552
+
6553
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
6554
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
6555
+ <xsl:value-of select="$char"/>
6556
+ </xsl:if>
6557
+
6558
+ <xsl:call-template name="interspers">
6559
+ <xsl:with-param name="str" select="substring($str, 2)"/>
6560
+ <xsl:with-param name="char" select="$char"/>
6561
+ </xsl:call-template>
6562
+ </xsl:if>
6519
6563
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
6520
6564
  <xsl:apply-templates mode="syntax_highlight"/>
6521
6565
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -7029,11 +7073,24 @@
7029
7073
  </xsl:template><xsl:template match="*[local-name() = 'author']">
7030
7074
  <xsl:text>— </xsl:text>
7031
7075
  <xsl:apply-templates/>
7032
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
7076
+ </xsl:template><xsl:variable name="bibitems_">
7077
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
7078
+ <xsl:copy-of select="."/>
7079
+ </xsl:for-each>
7080
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
7081
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
7082
+ <xsl:copy-of select="."/>
7083
+ </xsl:for-each>
7084
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
7085
+ <xsl:copy-of select="."/>
7086
+ </xsl:for-each>
7087
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
7033
7088
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7034
- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
7089
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
7090
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
7035
7091
  <xsl:choose>
7036
- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
7092
+ <!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
7093
+ <xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid])"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
7037
7094
  <fo:inline xsl:use-attribute-sets="eref-style">
7038
7095
  <xsl:if test="@type = 'footnote'">
7039
7096
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -8160,7 +8217,7 @@
8160
8217
  <xsl:copy>
8161
8218
  <xsl:copy-of select="@*"/>
8162
8219
  <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
8163
- <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
8220
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
8164
8221
  <xsl:sort select="@displayorder" data-type="number"/>
8165
8222
  <xsl:apply-templates select="." mode="update_xml_step1"/>
8166
8223
  </xsl:for-each>
@@ -8409,22 +8466,25 @@
8409
8466
  <xsl:param name="pText" select="."/>
8410
8467
  <xsl:param name="sep" select="','"/>
8411
8468
  <xsl:param name="normalize-space" select="'true'"/>
8469
+ <xsl:param name="keep_sep" select="'false'"/>
8412
8470
  <xsl:if test="string-length($pText) &gt;0">
8413
- <item>
8414
- <xsl:choose>
8415
- <xsl:when test="$normalize-space = 'true'">
8416
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8417
- </xsl:when>
8418
- <xsl:otherwise>
8419
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8420
- </xsl:otherwise>
8421
- </xsl:choose>
8422
- </item>
8423
- <xsl:call-template name="split">
8424
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8425
- <xsl:with-param name="sep" select="$sep"/>
8426
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
8427
- </xsl:call-template>
8471
+ <item>
8472
+ <xsl:choose>
8473
+ <xsl:when test="$normalize-space = 'true'">
8474
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8475
+ </xsl:when>
8476
+ <xsl:otherwise>
8477
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8478
+ </xsl:otherwise>
8479
+ </xsl:choose>
8480
+ </item>
8481
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
8482
+ <xsl:call-template name="split">
8483
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8484
+ <xsl:with-param name="sep" select="$sep"/>
8485
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
8486
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
8487
+ </xsl:call-template>
8428
8488
  </xsl:if>
8429
8489
  </xsl:template><xsl:template name="getDocumentId">
8430
8490
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.0.5".freeze
3
+ VERSION = "2.0.6".freeze
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-07 00:00:00.000000000 Z
11
+ date: 2022-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  - !ruby/object:Gem::Version
299
299
  version: '0'
300
300
  requirements: []
301
- rubygems_version: 3.2.32
301
+ rubygems_version: 3.3.9
302
302
  signing_key:
303
303
  specification_version: 4
304
304
  summary: metanorma-iec lets you write IEC standards in AsciiDoc.