Skip to content

Commit

Permalink
Merged branch '2.3' of ezsystems/ezplatform-richtext into 4.5 (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz authored Jul 19, 2023
2 parents b44a9b1 + 7fa3936 commit 2ff8861
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/bundle/Resources/richtext/stylesheets/xhtml5/edit/docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</xsl:if>
<xsl:if test="contains( @style, 'text-align:' )">
<xsl:variable name="textAlign">
<xsl:call-template name="extractStyleValue">
<xsl:call-template name="extractTextAlignValue">
<xsl:with-param name="style" select="@style"/>
<xsl:with-param name="property" select="'text-align'"/>
</xsl:call-template>
Expand Down Expand Up @@ -314,7 +314,7 @@
</xsl:if>
<xsl:if test="contains( @style, 'text-align:' )">
<xsl:variable name="textAlign">
<xsl:call-template name="extractStyleValue">
<xsl:call-template name="extractTextAlignValue">
<xsl:with-param name="style" select="@style"/>
<xsl:with-param name="property" select="'text-align'"/>
</xsl:call-template>
Expand Down Expand Up @@ -746,7 +746,7 @@
</xsl:if>
<xsl:if test="contains( @style, 'text-align:' )">
<xsl:variable name="textAlign">
<xsl:call-template name="extractStyleValue">
<xsl:call-template name="extractTextAlignValue">
<xsl:with-param name="style" select="@style"/>
<xsl:with-param name="property" select="'text-align'"/>
</xsl:call-template>
Expand Down Expand Up @@ -805,6 +805,24 @@
<xsl:value-of select="translate( substring-before( substring-after( concat( substring-after( $style, $property ), ';' ), ':' ), ';' ), ' ', '' )"/>
</xsl:template>

<xsl:template name="extractTextAlignValue">
<xsl:param name="style"/>
<xsl:param name="property"/>
<xsl:variable name="alignValue">
<xsl:call-template name="extractStyleValue">
<xsl:with-param name="style" select="$style"/>
<xsl:with-param name="property" select="$property"/>
</xsl:call-template>
</xsl:variable>

<xsl:choose>
<xsl:when test="$alignValue = 'left' or $alignValue = 'center' or $alignValue = 'right' or $alignValue = 'justify'">
<xsl:value-of select="$alignValue"/>
</xsl:when>
<xsl:otherwise>left</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="normalizeWidth">
<xsl:param name="width"/>
<xsl:choose>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<section
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ezxhtml="http://ibexa.co/xmlns/dxp/docbook/xhtml"
xmlns:ezcustom="http://ibexa.co/xmlns/dxp/docbook/custom"
version="5.0-variant ezpublish-1.0">
<para ezxhtml:textalign="left">Some text</para>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://ibexa.co/namespaces/ezpublish5/xhtml5/edit">
<p style="text-align:start;">Some text</p>
</section>

0 comments on commit 2ff8861

Please sign in to comment.