metanorma-itu 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2060,7 +2060,7 @@
2060
2060
  </xsl:if>
2061
2061
  </xsl:template>
2062
2062
 
2063
- <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">
2063
+ <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">
2064
2064
  <xsl:call-template name="getLang"/>
2065
2065
  </xsl:variable><xsl:variable name="pageWidth_">
2066
2066
  210
@@ -6628,7 +6628,51 @@
6628
6628
  <xsl:with-param name="text" select="$text_step1"/>
6629
6629
  </xsl:call-template>
6630
6630
  </xsl:variable>
6631
- <xsl:value-of select="$text_step2"/>
6631
+
6632
+ <!-- <xsl:value-of select="$text_step2"/> -->
6633
+
6634
+ <!-- add zero-width space after space -->
6635
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
6636
+
6637
+ <!-- split text by zero-width space -->
6638
+ <xsl:variable name="text_step4">
6639
+ <xsl:call-template name="split">
6640
+ <xsl:with-param name="pText" select="$text_step3"/>
6641
+ <xsl:with-param name="sep" select="$zero_width_space"/>
6642
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
6643
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
6644
+ </xsl:call-template>
6645
+ </xsl:variable>
6646
+
6647
+ <xsl:for-each select="xalan:nodeset($text_step4)/item">
6648
+ <xsl:choose>
6649
+ <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6650
+ <xsl:call-template name="interspers">
6651
+ <xsl:with-param name="str" select="."/>
6652
+ </xsl:call-template>
6653
+ </xsl:when>
6654
+ <xsl:otherwise>
6655
+ <xsl:value-of select="."/>
6656
+ </xsl:otherwise>
6657
+ </xsl:choose>
6658
+ </xsl:for-each>
6659
+
6660
+ </xsl:template><xsl:template name="interspers">
6661
+ <xsl:param name="str"/>
6662
+ <xsl:param name="char" select="$zero_width_space"/>
6663
+ <xsl:if test="$str != ''">
6664
+ <xsl:value-of select="substring($str, 1, 1)"/>
6665
+
6666
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
6667
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
6668
+ <xsl:value-of select="$char"/>
6669
+ </xsl:if>
6670
+
6671
+ <xsl:call-template name="interspers">
6672
+ <xsl:with-param name="str" select="substring($str, 2)"/>
6673
+ <xsl:with-param name="char" select="$char"/>
6674
+ </xsl:call-template>
6675
+ </xsl:if>
6632
6676
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
6633
6677
  <xsl:apply-templates mode="syntax_highlight"/>
6634
6678
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -7136,11 +7180,24 @@
7136
7180
  </xsl:template><xsl:template match="*[local-name() = 'author']">
7137
7181
  <xsl:text>— </xsl:text>
7138
7182
  <xsl:apply-templates/>
7139
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
7183
+ </xsl:template><xsl:variable name="bibitems_">
7184
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
7185
+ <xsl:copy-of select="."/>
7186
+ </xsl:for-each>
7187
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
7188
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
7189
+ <xsl:copy-of select="."/>
7190
+ </xsl:for-each>
7191
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
7192
+ <xsl:copy-of select="."/>
7193
+ </xsl:for-each>
7194
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
7140
7195
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7141
- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
7196
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
7197
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
7142
7198
  <xsl:choose>
7143
- <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) -->
7199
+ <!-- <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) -->
7200
+ <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) -->
7144
7201
  <fo:inline xsl:use-attribute-sets="eref-style">
7145
7202
  <xsl:if test="@type = 'footnote'">
7146
7203
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -8291,7 +8348,7 @@
8291
8348
  <xsl:copy>
8292
8349
  <xsl:copy-of select="@*"/>
8293
8350
  <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
8294
- <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
8351
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
8295
8352
  <xsl:sort select="@displayorder" data-type="number"/>
8296
8353
  <xsl:apply-templates select="." mode="update_xml_step1"/>
8297
8354
  </xsl:for-each>
@@ -8540,22 +8597,25 @@
8540
8597
  <xsl:param name="pText" select="."/>
8541
8598
  <xsl:param name="sep" select="','"/>
8542
8599
  <xsl:param name="normalize-space" select="'true'"/>
8600
+ <xsl:param name="keep_sep" select="'false'"/>
8543
8601
  <xsl:if test="string-length($pText) &gt;0">
8544
- <item>
8545
- <xsl:choose>
8546
- <xsl:when test="$normalize-space = 'true'">
8547
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8548
- </xsl:when>
8549
- <xsl:otherwise>
8550
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8551
- </xsl:otherwise>
8552
- </xsl:choose>
8553
- </item>
8554
- <xsl:call-template name="split">
8555
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8556
- <xsl:with-param name="sep" select="$sep"/>
8557
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
8558
- </xsl:call-template>
8602
+ <item>
8603
+ <xsl:choose>
8604
+ <xsl:when test="$normalize-space = 'true'">
8605
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8606
+ </xsl:when>
8607
+ <xsl:otherwise>
8608
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8609
+ </xsl:otherwise>
8610
+ </xsl:choose>
8611
+ </item>
8612
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
8613
+ <xsl:call-template name="split">
8614
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8615
+ <xsl:with-param name="sep" select="$sep"/>
8616
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
8617
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
8618
+ </xsl:call-template>
8559
8619
  </xsl:if>
8560
8620
  </xsl:template><xsl:template name="getDocumentId">
8561
8621
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.0.5".freeze
3
+ VERSION = "2.0.6".freeze
4
4
  end
5
5
  end
@@ -40,6 +40,6 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency "sassc", "2.4.0"
41
41
  spec.add_development_dependency "simplecov", "~> 0.15"
42
42
  spec.add_development_dependency "timecop", "~> 0.9"
43
- spec.add_development_dependency "vcr", "~> 5.0.0"
43
+ spec.add_development_dependency "vcr", "~> 6.1.0"
44
44
  spec.add_development_dependency "webmock"
45
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
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: exe
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: htmlentities
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: 5.0.0
229
+ version: 6.1.0
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: 5.0.0
236
+ version: 6.1.0
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: webmock
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -355,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  - !ruby/object:Gem::Version
356
356
  version: '0'
357
357
  requirements: []
358
- rubygems_version: 3.2.32
358
+ rubygems_version: 3.3.9
359
359
  signing_key:
360
360
  specification_version: 4
361
361
  summary: Metanorma for the ITU