# HG changeset patch # User Edouard Tisserant # Date 1615455323 -3600 # Node ID 9038655c1b187b1a94983eb48b6f92ed42cde23f # Parent 1d3408e46ab1cce9537b29b0f77f1b49a90686bf Backed out changeset b2ba6eeb61ec. Users reported text styling being messed in some cases. diff -r 1d3408e46ab1 -r 9038655c1b18 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Thu Mar 11 09:13:51 2021 +0100 +++ b/svghmi/gen_index_xhtml.xslt Thu Mar 11 10:35:23 2021 +0100 @@ -5520,21 +5520,7 @@ <xsl:text> styles: { </xsl:text> <xsl:for-each select="$hmi_element/*[@inkscape:label]"> - <xsl:variable name="text" select="func:refered_elements(.)[self::svg:text][1]"/> - <xsl:variable name="tspan" select="$text/svg:tspan[1]"/> - <xsl:variable name="style"> - <xsl:choose> - <xsl:when test="$text/@style and $tspan/@style"> - <xsl:value-of select="$text/@style"/> - <xsl:text>;</xsl:text> - <xsl:value-of select="$tspan/@style"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$text/@style"/> - <xsl:value-of select="$tspan/@style"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> + <xsl:variable name="style" select="func:refered_elements(.)[self::svg:text]/@style"/> <xsl:text> </xsl:text> <xsl:value-of select="@inkscape:label"/> <xsl:text>: "</xsl:text> diff -r 1d3408e46ab1 -r 9038655c1b18 svghmi/widget_list.ysl2 --- a/svghmi/widget_list.ysl2 Thu Mar 11 09:13:51 2021 +0100 +++ b/svghmi/widget_list.ysl2 Thu Mar 11 10:35:23 2021 +0100 @@ -13,13 +13,7 @@ param "hmi_element"; | styles: { foreach "$hmi_element/*[@inkscape:label]" { - const "text", "func:refered_elements(.)[self::svg:text][1]"; - const "tspan", "$text/svg:tspan[1]"; - const "style" choose { - when "$text/@style and $tspan/@style" > «$text/@style»;«$tspan/@style» - otherwise > «$text/@style»«$tspan/@style» - - } + const "style", "func:refered_elements(.)[self::svg:text]/@style"; | «@inkscape:label»: "«$style»", } | },