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

Embedding any block in a text paragraph breaks linked images #3569

Closed
bberndt-uaz opened this issue Jul 25, 2024 · 2 comments
Closed

Embedding any block in a text paragraph breaks linked images #3569

bberndt-uaz opened this issue Jul 25, 2024 · 2 comments
Labels
bug Something isn't working usability Improvements to usability of Quickstart components

Comments

@bberndt-uaz
Copy link
Contributor

Describe the bug

A link may be added to an image embedded in a text paragraph by clicking on the image to select it and then clicking the Link media button in the pop-up media toolbar. See this issue regarding the implementation of this feature in Quickstart: Allow displaying images as linked images #2366.

However, if a block is embedded in the same text area, the link for the image will not work on the published page. Any block causes this behavior, even an empty flexible block.

Note: For guidance about the accessible use of images, especially those that are linked, see https://www.w3.org/WAI/tutorials/images/.

To Reproduce

Steps to reproduce the behavior:

  1. When editing a page, add a new Text paragraph to a page by clicking the Add Text button.
  2. Click the Insert Media button in the editor toolbar.
  3. Select an image and insert it into the text area.
  4. Click the image to select it.
  5. Click the Link media button in the row of icons above/below the image.
  6. Enter any link and click the green check mark button.
  7. Click elsewhere in the text area to deselect the image (you may need to click the new line button on the image).
  8. Click the Embed Content Block button in the editor toolbar.
  9. Select any block, click the Next button, and then click the Embed button.
  10. Save the page.
  11. Observe that the image link does not work on the published page.

Proposed resolution

This may be a CKEditor 5 issue. As a workaround, users can arrange their content to ensure that linked images are not embedded in the same text paragraph as a content block.

Expected behavior

Linked images should be functional regardless of what other content is embedded in the same text paragraph.

Additional context

When the link of the linked image works correctly, it appears that the HTML of that section is malformed: the <p> element containing the <a> element is closed before the <a> element is closed. Then, after the <a> element is closed, an extra unclosed <p> tag is added.

@bberndt-uaz bberndt-uaz added bug Something isn't working usability Improvements to usability of Quickstart components labels Jul 25, 2024
@joeparsons
Copy link
Member

@bberndt-uaz
Copy link
Contributor Author

This issue was likely introduced in Quickstart 2.9.0. In testing a couple sites, I found that the issue was not present on a Quickstart 2.8.3 site, but it was present on a Quickstart 2.9.5 site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working usability Improvements to usability of Quickstart components
Projects
None yet
Development

No branches or pull requests

2 participants