Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23513

in eZXMLText, a <P> tag is being add to a link when it surrounds an image

    XMLWordPrintable

    Details

    • Sprint:
      Pollux Core S5

      Description

      Please check Links around embedded images produce broken HTML, on eZ Community, for more details.

      If you add an image to an eZXMLText attribute and suround the image with a link, a <P> tag will be added in the frontend what not only breaks the formatting but differs from what was been doing in legacy.

      Steps to Reproduce

      <link href="http://google.com"><embed view="embed" size="medium" custom:offset="0" custom:limit="5" href="ezobject://110" /></link>
      
      • Create an article
      • Replicate the code below in eZOE by executing the following actions:
        • In the body attribute, insert an image and leave all the options as default.
        • Click on the image, add a link and make it point to google (for example).
      • Publish the article
      • In ezpublish.yml, add "legacy_mode: true" to one of your siteaccesses to make sure the design will be legacy
      • Clear the caches
      • Open the article in two different siteaccesses: one with "legacy_mode: true", the other standard for the new stack
      • Inspect the webpage's code

      Legacy siteaccess's code

      <code>
      <div class=""><div class="content-view-embed">
      	<div class="class-image">
      		<div class="attribute-image">
      			<a href="http://google.com" target="_self">
      				<img src="/var/ezdemo_site/storage/images/media/images/funel/526-1-eng-GB/funel_medium.png" 
                                              width="200" height="124"  style="border: 0px solid ;"
                                              alt="funel" title="funel" />
      			</a>    
      </code>
      

      Symfony siteaccess's code

      <div class="attribute-long">
      	<div class="ezxmltext-field">
      		<p>
      			<a href="http://google.com" target="_self">
      				<div>
      					<div class="content-view-embed">
      						<div class="class-image">
      							<div class="attribute-image">
      								<img src="/var/ezdemo_site/storage/images/media/images/funel/526-1-eng-GB/funel_medium.png"
      									 width="200" height="124"  style="border: 0px solid ;"
      									 alt="funel" title="funel" />
      

      As you can see, there's a "<P>" tag surrounding the link in the Symfony stack.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              eduardo.fernandes-obsolete@ez.no Eduardo Fernandes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 4 days, 7 hours, 55 minutes
                  1w 4d 7h 55m