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-29658: Changed OE format for ezembed > ezlink tag to anchor tag #20

Merged
merged 2 commits into from Dec 4, 2018

Conversation

@alongosz
Copy link
Member

alongosz commented Nov 29, 2018

Question Answer
JIRA issue EZP-29658
Required by
Bug/Improvement no
New feature yes
Target version 1.0 (master) for eZ Platform 2.4
BC breaks yes
Tests pass yes
Doc needed yes

XHTML5Edit (Online Editor) format transforms ezlink inside ezembed into link tag which is semantically incorrect[1] which makes Online Editor unable to handle that HTML.

It needs to be replaced by an anchor ("a") tag. This change applies to the Online Editor format only, keeping DocBook one as-is.

[1] link tag actually belongs to meta tags per HTML5 spec.

BC note

Online Editor internal format (a.k.a XHTML5Edit format) for linked ezembed and ezembedinline changes:

ezembed

Before:

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://ez.no/namespaces/ezpublish5/xhtml5/edit">
  <div data-ezelement="ezembed" data-href="ezlocation://601" id="embed-id-2" data-ezview="line" class="embedClass2" data-ezalign="right">
    <link itemprop="url" data-ezelement="ezlink" href="ezlocation://202" class="linkClass2"/>
  </div>
</section>

After:

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://ez.no/namespaces/ezpublish5/xhtml5/edit">
  <div data-ezelement="ezembed" data-href="ezlocation://601" id="embed-id-2" data-ezview="line" class="embedClass2" data-ezalign="right">
    <a data-ezelement="ezlink" href="ezlocation://202" class="linkClass2"> </a>
  </div>
</section>

ezembedinline

Before:

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://ez.no/namespaces/ezpublish5/xhtml5/edit">
  <p>Some
    <span itemscope="itemscope" data-ezelement="ezembedinline" id="id3" data-href="ezcontent://601"
          data-ezview="embed-inline-custom" class="embedClass" data-ezalign="left">
      <link itemprop="url" data-ezelement="ezlink" href="ezcontent://106" id="id4" target="_blank"
            title="Link title" class="linkClass"/>
    </span>
    for the otherwise unremarkable paragraph.
  </p>
</section>

After:

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://ez.no/namespaces/ezpublish5/xhtml5/edit">
  <p>Some
    <span data-ezelement="ezembedinline" id="id3" data-href="ezcontent://601"
          data-ezview="embed-inline-custom" class="embedClass" data-ezalign="left">
      <a data-ezelement="ezlink" href="ezcontent://106" id="id4" target="_blank" title="Link title"
         class="linkClass"></a>
    </span>
    for the otherwise unremarkable paragraph.
  </p>
</section>

Please note that, due to BC promise, while RichText Converters still can convert old Online Editor format to DocBook, this operation is not symmetric, so converting from DocBook to Online Editor format results in the new changed format.

DocBook format for ezembed and ezembedinline remains as it was before:

<?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://ez.no/xmlns/ezpublish/docbook/xhtml"
         xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom"
         version="5.0-variant ezpublish-1.0">
  <ezembed xlink:href="ezlocation://601" view="line" xml:id="embed-id-2" ezxhtml:class="embedClass2" ezxhtml:align="right">
    <ezlink xlink:href="ezlocation://202" ezxhtml:class="linkClass2"/>
  </ezembed>
</section>

and

<?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://ez.no/xmlns/ezpublish/docbook/xhtml"
         xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom"
         version="5.0-variant ezpublish-1.0">
  <para>Some
    <ezembedinline xlink:href="ezcontent://601" view="embed-inline-custom" xml:id="id3"
                   ezxhtml:class="embedClass" ezxhtml:align="left">
      <ezlink xlink:href="ezcontent://106" xml:id="id4" xlink:title="Link title"
              ezxhtml:class="linkClass"/>
    </ezembedinline>
    for the otherwise unremarkable paragraph.
  </para>
</section>

respectively.

TODO:

  • Transform ezlink inside ezembed into a instead of link.
  • Align tests.
  • Provide BC (XHTML5Edit -> DocBook, the other way around is impossible).
  • Fix new code according to Coding Standards ($ composer fix-cs).
  • Ask for Code Review.

alongosz added some commits Nov 29, 2018

EZP-29658: Changed OE format for ezembed > ezlink tag to anchor tag
XHTML5Edit (Online Editor) format transforms ezlink inside ezembed
into link tag which is semantically incorrect[1] and Online Editor
is unable to handle that properly.

It needs to be replaced by an anchor ("a") tag.
This change applies to Online Editor format only, keeping DocBook as-is.

[1] link tag actually belongs to meta tags per HTML5 spec.
EZP-29658: Provided BC for link inside ezembed for XHTML5Edit format
BC applies to converting XHTML5Edit to DocBook, the other way around
is not possible

@alongosz alongosz force-pushed the alongosz:ezp-29658-change-xhtml5edit-ezembed-ezlink-format branch from 6b5f916 to 9aab819 Nov 30, 2018

@alongosz alongosz changed the title [WiP] EZP-29658: Changed OE format for ezembed > ezlink tag to anchor tag EZP-29658: Changed OE format for ezembed > ezlink tag to anchor tag Nov 30, 2018

@alongosz alongosz requested review from kmadejski and konradoboza Nov 30, 2018

@webhdx

webhdx approved these changes Nov 30, 2018

@katarzynazawada katarzynazawada self-assigned this Dec 3, 2018

@lserwatka lserwatka merged commit c4aa555 into ezsystems:master Dec 4, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@alongosz alongosz deleted the alongosz:ezp-29658-change-xhtml5edit-ezembed-ezlink-format branch Dec 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment