Skip to content

Commit 2ff8861

Browse files
authored
Merged branch '2.3' of ezsystems/ezplatform-richtext into 4.5 (#110)
Cross merge of ezsystems/ezplatform-richtext#233.
2 parents b44a9b1 + 7fa3936 commit 2ff8861

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

src/bundle/Resources/richtext/stylesheets/xhtml5/edit/docbook.xsl

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
</xsl:if>
100100
<xsl:if test="contains( @style, 'text-align:' )">
101101
<xsl:variable name="textAlign">
102-
<xsl:call-template name="extractStyleValue">
102+
<xsl:call-template name="extractTextAlignValue">
103103
<xsl:with-param name="style" select="@style"/>
104104
<xsl:with-param name="property" select="'text-align'"/>
105105
</xsl:call-template>
@@ -314,7 +314,7 @@
314314
</xsl:if>
315315
<xsl:if test="contains( @style, 'text-align:' )">
316316
<xsl:variable name="textAlign">
317-
<xsl:call-template name="extractStyleValue">
317+
<xsl:call-template name="extractTextAlignValue">
318318
<xsl:with-param name="style" select="@style"/>
319319
<xsl:with-param name="property" select="'text-align'"/>
320320
</xsl:call-template>
@@ -746,7 +746,7 @@
746746
</xsl:if>
747747
<xsl:if test="contains( @style, 'text-align:' )">
748748
<xsl:variable name="textAlign">
749-
<xsl:call-template name="extractStyleValue">
749+
<xsl:call-template name="extractTextAlignValue">
750750
<xsl:with-param name="style" select="@style"/>
751751
<xsl:with-param name="property" select="'text-align'"/>
752752
</xsl:call-template>
@@ -805,6 +805,24 @@
805805
<xsl:value-of select="translate( substring-before( substring-after( concat( substring-after( $style, $property ), ';' ), ':' ), ';' ), ' ', '' )"/>
806806
</xsl:template>
807807

808+
<xsl:template name="extractTextAlignValue">
809+
<xsl:param name="style"/>
810+
<xsl:param name="property"/>
811+
<xsl:variable name="alignValue">
812+
<xsl:call-template name="extractStyleValue">
813+
<xsl:with-param name="style" select="$style"/>
814+
<xsl:with-param name="property" select="$property"/>
815+
</xsl:call-template>
816+
</xsl:variable>
817+
818+
<xsl:choose>
819+
<xsl:when test="$alignValue = 'left' or $alignValue = 'center' or $alignValue = 'right' or $alignValue = 'justify'">
820+
<xsl:value-of select="$alignValue"/>
821+
</xsl:when>
822+
<xsl:otherwise>left</xsl:otherwise>
823+
</xsl:choose>
824+
</xsl:template>
825+
808826
<xsl:template name="normalizeWidth">
809827
<xsl:param name="width"/>
810828
<xsl:choose>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<section
3+
xmlns="http://docbook.org/ns/docbook"
4+
xmlns:xlink="http://www.w3.org/1999/xlink"
5+
xmlns:ezxhtml="http://ibexa.co/xmlns/dxp/docbook/xhtml"
6+
xmlns:ezcustom="http://ibexa.co/xmlns/dxp/docbook/custom"
7+
version="5.0-variant ezpublish-1.0">
8+
<para ezxhtml:textalign="left">Some text</para>
9+
</section>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<section xmlns="http://ibexa.co/namespaces/ezpublish5/xhtml5/edit">
3+
<p style="text-align:start;">Some text</p>
4+
</section>

0 commit comments

Comments
 (0)