Skip to content
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-23831: As a UI dev, I need format of RichText field over REST to be semantically enhanced xhtml5 #1435

Merged
merged 4 commits into from
Oct 8, 2015

Conversation

pspanja
Copy link
Contributor

@pspanja pspanja commented Oct 2, 2015

This PR resolves https://jira.ez.no/browse/EZP-23831

This replaces usage of custom elements in xhtml5edit format with standard XHTML5 elements.
Replaced elements are only those relating to embeds:

  • ezlink => link
  • ezconfig => span
  • ezvalue => span
  • ezembed => div
  • ezembedinline => span

Template elements are also affected but skipped here as they are not in the current scope from the UI side and there seems to be some questions to answer there first.

Using same elements in different context is done through data-ezelement attribute. A format like that can't be properly described using XSD, which will become a problem when template elements are handled in the same way. This could be described using RelaxNG and/or Schematron.

@pspanja
Copy link
Contributor Author

pspanja commented Oct 2, 2015

Review ping @dpobel @andrerom @bdunogier @lolautruche

POV on schema appreciated, do we need it here in the first place?

<xsl:template match="docbook:ezembed">
<xsl:element name="div" namespace="{$outputNamespace}">
<xsl:attribute name="data-ezelement">
<xsl:value-of select="'ezembed'"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: can be simplified to

<xsl:attribute name="data-ezelement">ezembed</xsl:attribute>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified in 0f2c9f6

@lolautruche
Copy link
Contributor

Looks good AFAICT

<ezlink href="ezlocation://202" class="linkClass2"/>
</ezembed>
<div data-ezelement="ezembed" href="ezcontent://106" id="embed-id-1" data-ezview="embed" class="embed-class" data-ezalign="left">
<a data-ezelement="ezlink" href="ezurl://95#fragment1" target="_blank" id="link-id-1" title="Link title" class="link-class"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a weird markup, to improve it a bit, I would rather use a link tag here. According to http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-link-element, it should have an itemprop attribute, I suggest to set its value to url and that also means the div has to have an itemscope attribute as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that element supposed to occur only in metadata content (head)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see: http://www.w3.org/html/wg/drafts/html/master/dom.html#phrasing-content-2
When it has itemprop it can be used as phrasing-content.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, updated in 4eba931.

@andrerom
Copy link
Contributor

andrerom commented Oct 2, 2015

Looks, good so far, I'm a bit concerned by usage of same tag for different things, but I'm also aware we should stay as close to the format supported by editor as possible to avoid tons of issues over the next couple of years (see ezoe).

@pspanja
Copy link
Contributor Author

pspanja commented Oct 5, 2015

Removed schema for http://ez.no/namespaces/ezpublish5/xhtml5/edit in 1da8dd2.
I assumed everyone is ok with that.

@pspanja
Copy link
Contributor Author

pspanja commented Oct 5, 2015

All remarks taken care of BTW :)

git review --continue

@glye
Copy link
Member

glye commented Oct 5, 2015

+1 fwiw, simplification sounds good.

@andrerom
Copy link
Contributor

andrerom commented Oct 5, 2015

+1, side: should we consider renaming this format to xhtml5-semantic or something?

@pspanja
Copy link
Contributor Author

pspanja commented Oct 5, 2015

@andrerom I was thinking something in the xhtml5-edit-alloy line :)

@andrerom
Copy link
Contributor

andrerom commented Oct 5, 2015

I was thinking something in the xhtml5-edit-alloy line :)

ok, lets leave the name discussion for later, get your point :)

@pspanja pspanja force-pushed the impl-EZP-23831-xhtml5edit-xhtml5 branch from 1da8dd2 to 8c8889c Compare October 8, 2015 10:42
pspanja added a commit that referenced this pull request Oct 8, 2015
EZP-23831: As a UI dev, I need format of RichText field over REST to be semantically enhanced xhtml5
@pspanja pspanja merged commit 84aa2c0 into master Oct 8, 2015
@pspanja pspanja deleted the impl-EZP-23831-xhtml5edit-xhtml5 branch October 8, 2015 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants