metanorma-ribose 2.4.3 → 2.4.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc2ec5eeef14d9e06ebd9eca89316b6063d00f6f777d68b60df5d4908efc182e
4
- data.tar.gz: 02bede05c476fea899b62630855f888dbf1abc7680ca1b7d9b2cecf1b4ab3f0b
3
+ metadata.gz: 7ce8de0432273f5b9ba03eeb10aa7c494698cf0d84701dd9e945a7bd1228665b
4
+ data.tar.gz: cb59e908e459a490b6edcf44f7caf0f6622079cd96591d74c03cb19b3dc49615
5
5
  SHA512:
6
- metadata.gz: a0de437c7729d1d4b95faaedc1e7f036b9902f77af20c464051bf957fd80f9c03a4948dde957d5d57fae095742c38bdd789a4cc11687488ffc95d3dfb85d7698
7
- data.tar.gz: 10ba2c72751a3c91a9d9451b364a76690ddfe70ad10b197a81bb2d9f27f57d760224b4c2e7dcec86fac63741d8171dcc9d7dc50e24737ba140f51dc80c2962d7
6
+ metadata.gz: 1575984cc44861b1cec45264eace9db1a8733a8e135ac6d06e2a7cb2b32a882e7617531b6665caf9c6dd692e72d312087d1f98f75556a979e6745f041c8236b5
7
+ data.tar.gz: 673c558664981e0eca5a2965ca6cb4222a6281d94465a8e0e85eac029c26b31813188206e5a10e02dad4cdcfd7f0e20f79b61d0500f29a3e733f2122fe8394b3
@@ -5570,7 +5570,8 @@
5570
5570
  </xsl:template>
5571
5571
 
5572
5572
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5573
- <xsl:variable name="text" select="normalize-space(.)"/>
5573
+ <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
5574
+ <xsl:variable name="text" select="."/>
5574
5575
  <fo:inline font-size="75%" role="SKIP">
5575
5576
  <xsl:if test="string-length($text) &gt; 0">
5576
5577
  <xsl:variable name="smallCapsText">
@@ -7710,16 +7711,44 @@
7710
7711
  </xsl:choose>
7711
7712
 
7712
7713
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7713
- <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7714
- <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
7714
+ <xsl:variable name="svg_width_" select="xalan:nodeset($svg_content)/*/@width"/>
7715
+ <xsl:variable name="svg_width" select="number(translate($svg_width_, 'px', ''))"/>
7716
+ <xsl:variable name="svg_height_" select="xalan:nodeset($svg_content)/*/@height"/>
7717
+ <xsl:variable name="svg_height" select="number(translate($svg_height_, 'px', ''))"/>
7718
+
7719
+ <!-- Example: -->
7715
7720
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
7716
7721
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
7717
7722
  <!-- effective height / width = 1.48, 1.4 - with title -->
7718
- <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
7723
+
7724
+ <xsl:variable name="scale_x">
7725
+ <xsl:choose>
7726
+ <xsl:when test="$svg_width &gt; $width_effective_px">
7727
+ <xsl:value-of select="$width_effective_px div $svg_width"/>
7728
+ </xsl:when>
7729
+ <xsl:otherwise>1</xsl:otherwise>
7730
+ </xsl:choose>
7731
+ </xsl:variable>
7732
+ <xsl:variable name="scale_y">
7733
+ <xsl:choose>
7734
+ <xsl:when test="$svg_height * $scale_x &gt; $height_effective_px">
7735
+ <xsl:value-of select="$height_effective_px div ($svg_height * $scale_x)"/>
7736
+ </xsl:when>
7737
+ <xsl:otherwise>1</xsl:otherwise>
7738
+ </xsl:choose>
7739
+ </xsl:variable>
7740
+
7741
+ <!-- for images with big height -->
7742
+ <!-- <xsl:if test="$svg_height &gt; ($svg_width * 1.4)">
7719
7743
  <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
7720
7744
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
7721
- </xsl:if>
7745
+ </xsl:if> -->
7722
7746
  <xsl:attribute name="scaling">uniform</xsl:attribute>
7747
+
7748
+ <xsl:if test="$scale_y != 1">
7749
+ <xsl:attribute name="content-height"><xsl:value-of select="round($scale_x * $scale_y * 100)"/>%</xsl:attribute>
7750
+ </xsl:if>
7751
+
7723
7752
  <xsl:copy-of select="$svg_content"/>
7724
7753
  </fo:instream-foreign-object>
7725
7754
  <!-- </fo:block> -->
@@ -7757,8 +7786,12 @@
7757
7786
  <xsl:variable name="width" select="normalize-space($viewbox//item[3])"/>
7758
7787
  <xsl:variable name="height" select="normalize-space($viewbox//item[4])"/>
7759
7788
 
7789
+ <xsl:variable name="parent_image_width" select="normalize-space(ancestor::*[1][local-name() = 'image']/@width)"/>
7790
+ <xsl:variable name="parent_image_height" select="normalize-space(ancestor::*[1][local-name() = 'image']/@height)"/>
7791
+
7760
7792
  <xsl:attribute name="width">
7761
7793
  <xsl:choose>
7794
+ <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7762
7795
  <xsl:when test="$width != ''">
7763
7796
  <xsl:value-of select="round($width)"/>
7764
7797
  </xsl:when>
@@ -7767,6 +7800,7 @@
7767
7800
  </xsl:attribute>
7768
7801
  <xsl:attribute name="height">
7769
7802
  <xsl:choose>
7803
+ <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7770
7804
  <xsl:when test="$height != ''">
7771
7805
  <xsl:value-of select="round($height)"/>
7772
7806
  </xsl:when>
@@ -7778,6 +7812,28 @@
7778
7812
  </xsl:copy>
7779
7813
  </xsl:template>
7780
7814
 
7815
+ <xsl:template match="*[local-name() = 'svg']/@width" mode="svg_update">
7816
+ <!-- image[@width]/svg -->
7817
+ <xsl:variable name="parent_image_width" select="normalize-space(ancestor::*[2][local-name() = 'image']/@width)"/>
7818
+ <xsl:attribute name="width">
7819
+ <xsl:choose>
7820
+ <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
7821
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7822
+ </xsl:choose>
7823
+ </xsl:attribute>
7824
+ </xsl:template>
7825
+
7826
+ <xsl:template match="*[local-name() = 'svg']/@height" mode="svg_update">
7827
+ <!-- image[@height]/svg -->
7828
+ <xsl:variable name="parent_image_height" select="normalize-space(ancestor::*[2][local-name() = 'image']/@height)"/>
7829
+ <xsl:attribute name="height">
7830
+ <xsl:choose>
7831
+ <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
7832
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7833
+ </xsl:choose>
7834
+ </xsl:attribute>
7835
+ </xsl:template>
7836
+
7781
7837
  <!-- regex for 'display: inline-block;' -->
7782
7838
  <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7783
7839
  <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
@@ -9852,7 +9908,9 @@
9852
9908
  </xsl:template> <!-- sections_element_style -->
9853
9909
 
9854
9910
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
9855
- <fo:block break-after="page"/>
9911
+
9912
+ <fo:block break-after="page"/>
9913
+
9856
9914
  <fo:block>
9857
9915
  <xsl:call-template name="setId"/>
9858
9916
  <xsl:apply-templates/>
@@ -9919,7 +9977,7 @@
9919
9977
  <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9920
9978
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9921
9979
  </xsl:when>
9922
- <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
9980
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
9923
9981
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9924
9982
  </xsl:when>
9925
9983
  </xsl:choose>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.4.3".freeze
3
+ VERSION = "2.4.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.3
4
+ version: 2.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-04 00:00:00.000000000 Z
11
+ date: 2024-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic