-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-30507: Strict possible values for align attribute #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs to be based against 1.7, not master
<xsl:otherwise> | ||
<!-- we can not use custom values here, as it will break richtext shema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove this <xsl:otherwise>
block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bdf375d
to
6d373a0
Compare
6d373a0
to
f9aaf32
Compare
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:attribute> | ||
<xsl:call-template name="customtagalign"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you call customtagalign
for embed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this change any custom value was allowed for embed's ezxhtml:align
. And it is wrong, and in some cases might cause validation errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this change any custom value was allowed for embed's
ezxhtml:align
. And it is wrong, and in some cases might cause validation errors.
Still don't follow what is the relation between embed and custom tags in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ezembed
(as well as custom tags) uses ezxhtml:align
attribute. And possible values here are: center
, left
and right
(https://github.com/ezsystems/ezplatform-richtext/blob/master/src/lib/eZ/RichText/Resources/schemas/docbook/ezpublish.rng#L758-L769). And we are using the same xsl function (customtagalign
) to handle that attribute for embeds and custom tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template should just be named align
, then we have a template textalign
which deals with ezxhtml:textalign
, and a align
which deals with ezxhtml:align
lib/FieldType/XmlText/Input/Resources/stylesheets/eZXml2Docbook_core.xsl
Show resolved
Hide resolved
@alongosz sorry, how can we fix |
@SerheyDolgushev I'll have a look at it EDIT: See #108 |
@SerheyDolgushev #108 is merged, if you rebase the build should be green now |
64049dc
to
269a94c
Compare
@mnocon thanks, it helped! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template customtagalign
needs to be renamed. Besides that, OK
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:attribute> | ||
<xsl:call-template name="customtagalign"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template should just be named align
, then we have a template textalign
which deals with ezxhtml:textalign
, and a align
which deals with ezxhtml:align
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @SerheyDolgushev for your contribution
@andrerom can you please merge it in |
Thats the plan, but was hoping some of the other PR's would reach ready for merge as well first ;) |
1.7
There is a strict list of possible values for ezxhtml:textalign: https://github.com/ezsystems/ezplatform-richtext/blob/master/src/lib/eZ/RichText/Resources/schemas/docbook/ezpublish.rng#L744-L756.
So custom values there were causing validation errors. This PR fixes it.
TODO:
$ composer fix-cs
).