metanorma-cc 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: 3f95d9b70ea62da093f7baa6002949fada2f62294926a883c98d213d368ef662
4
- data.tar.gz: 54746529bdb2eb53ee458563933694b3e865a1d119493108681476383963c315
3
+ metadata.gz: aa2c9dce7ea4be7d9d9e0ecb41409259b969b3e8aadac3a4c7ce4c24b3b28c56
4
+ data.tar.gz: be0b9e664feb6820742fd5a87b78accc36011f196ede0d5cb8f5b3d683d0f837
5
5
  SHA512:
6
- metadata.gz: 11016d1f310a139bc828a96202323f5fb5c4ca2b43779ed1ad9613567553317ca50183e1710d4f1ccf20c2e7af70703c44f0a097f0ce3bd33847fc24f53ce58a
7
- data.tar.gz: 1217b5e39d6556b41bc88ebb78ecf04ebad077a808da0f3387c5f026017e07407ac52dee1a0484330af19e94f3a71f66aae23d33145aeddee48c461bf6b0307b
6
+ metadata.gz: 1ae65d5c95a76259cf80ae730aae3691664c915dc03a7d3245993c806d39f2c01035d8b944901786b16006e3f7211ec85dcf65efc583d1a2be8848d587c3e673
7
+ data.tar.gz: 2a020aee734ba96c89a07c9c884341316ff4bb8304d4193cabb60c2fb228efeec284456b8b8b1f1712cea3ef2456e0743dee4ac9dd7cf93895d25fef10974f5e
@@ -560,7 +560,7 @@
560
560
  </xsl:template>
561
561
 
562
562
 
563
- <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">
563
+ <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">
564
564
  <xsl:call-template name="getLang"/>
565
565
  </xsl:variable><xsl:variable name="pageWidth_">
566
566
  210
@@ -5025,7 +5025,51 @@
5025
5025
  <xsl:with-param name="text" select="$text_step1"/>
5026
5026
  </xsl:call-template>
5027
5027
  </xsl:variable>
5028
- <xsl:value-of select="$text_step2"/>
5028
+
5029
+ <!-- <xsl:value-of select="$text_step2"/> -->
5030
+
5031
+ <!-- add zero-width space after space -->
5032
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
5033
+
5034
+ <!-- split text by zero-width space -->
5035
+ <xsl:variable name="text_step4">
5036
+ <xsl:call-template name="split">
5037
+ <xsl:with-param name="pText" select="$text_step3"/>
5038
+ <xsl:with-param name="sep" select="$zero_width_space"/>
5039
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
5040
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
5041
+ </xsl:call-template>
5042
+ </xsl:variable>
5043
+
5044
+ <xsl:for-each select="xalan:nodeset($text_step4)/item">
5045
+ <xsl:choose>
5046
+ <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5047
+ <xsl:call-template name="interspers">
5048
+ <xsl:with-param name="str" select="."/>
5049
+ </xsl:call-template>
5050
+ </xsl:when>
5051
+ <xsl:otherwise>
5052
+ <xsl:value-of select="."/>
5053
+ </xsl:otherwise>
5054
+ </xsl:choose>
5055
+ </xsl:for-each>
5056
+
5057
+ </xsl:template><xsl:template name="interspers">
5058
+ <xsl:param name="str"/>
5059
+ <xsl:param name="char" select="$zero_width_space"/>
5060
+ <xsl:if test="$str != ''">
5061
+ <xsl:value-of select="substring($str, 1, 1)"/>
5062
+
5063
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
5064
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
5065
+ <xsl:value-of select="$char"/>
5066
+ </xsl:if>
5067
+
5068
+ <xsl:call-template name="interspers">
5069
+ <xsl:with-param name="str" select="substring($str, 2)"/>
5070
+ <xsl:with-param name="char" select="$char"/>
5071
+ </xsl:call-template>
5072
+ </xsl:if>
5029
5073
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
5030
5074
  <xsl:apply-templates mode="syntax_highlight"/>
5031
5075
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -5533,11 +5577,24 @@
5533
5577
  </xsl:template><xsl:template match="*[local-name() = 'author']">
5534
5578
  <xsl:text>— </xsl:text>
5535
5579
  <xsl:apply-templates/>
5536
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
5580
+ </xsl:template><xsl:variable name="bibitems_">
5581
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
5582
+ <xsl:copy-of select="."/>
5583
+ </xsl:for-each>
5584
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
5585
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
5586
+ <xsl:copy-of select="."/>
5587
+ </xsl:for-each>
5588
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
5589
+ <xsl:copy-of select="."/>
5590
+ </xsl:for-each>
5591
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
5537
5592
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
5538
- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
5593
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
5594
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
5539
5595
  <xsl:choose>
5540
- <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) -->
5596
+ <!-- <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) -->
5597
+ <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) -->
5541
5598
  <fo:inline xsl:use-attribute-sets="eref-style">
5542
5599
  <xsl:if test="@type = 'footnote'">
5543
5600
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -6667,7 +6724,7 @@
6667
6724
  <xsl:copy>
6668
6725
  <xsl:copy-of select="@*"/>
6669
6726
  <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
6670
- <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
6727
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
6671
6728
  <xsl:sort select="@displayorder" data-type="number"/>
6672
6729
  <xsl:apply-templates select="." mode="update_xml_step1"/>
6673
6730
  </xsl:for-each>
@@ -6916,22 +6973,25 @@
6916
6973
  <xsl:param name="pText" select="."/>
6917
6974
  <xsl:param name="sep" select="','"/>
6918
6975
  <xsl:param name="normalize-space" select="'true'"/>
6976
+ <xsl:param name="keep_sep" select="'false'"/>
6919
6977
  <xsl:if test="string-length($pText) &gt;0">
6920
- <item>
6921
- <xsl:choose>
6922
- <xsl:when test="$normalize-space = 'true'">
6923
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
6924
- </xsl:when>
6925
- <xsl:otherwise>
6926
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
6927
- </xsl:otherwise>
6928
- </xsl:choose>
6929
- </item>
6930
- <xsl:call-template name="split">
6931
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
6932
- <xsl:with-param name="sep" select="$sep"/>
6933
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
6934
- </xsl:call-template>
6978
+ <item>
6979
+ <xsl:choose>
6980
+ <xsl:when test="$normalize-space = 'true'">
6981
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
6982
+ </xsl:when>
6983
+ <xsl:otherwise>
6984
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
6985
+ </xsl:otherwise>
6986
+ </xsl:choose>
6987
+ </item>
6988
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
6989
+ <xsl:call-template name="split">
6990
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
6991
+ <xsl:with-param name="sep" select="$sep"/>
6992
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
6993
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
6994
+ </xsl:call-template>
6935
6995
  </xsl:if>
6936
6996
  </xsl:template><xsl:template name="getDocumentId">
6937
6997
  <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 CC
3
- VERSION = "2.0.5".freeze
3
+ VERSION = "2.0.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
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: metanorma-generic
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  - !ruby/object:Gem::Version
251
251
  version: '0'
252
252
  requirements: []
253
- rubygems_version: 3.2.32
253
+ rubygems_version: 3.3.9
254
254
  signing_key:
255
255
  specification_version: 4
256
256
  summary: metanorma-cc lets you write CalConnect standards in AsciiDoc.