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

Support block-level anchor tags which wrap around an image element in the ProseMirror schema. #8275

Closed
Fyorl opened this issue Sep 26, 2022 · 6 comments
Assignees
Labels
bug Functionality which is not working as intended text-editor Issues related to the ProseMirror or legacy TinyMCE text editor

Comments

@Fyorl
Copy link
Contributor

Fyorl commented Sep 26, 2022

Originally reported by MrPrimate#8701 https://discord.com/channels/170995199584108546/956306859491471420/1022431116222804009

ALL MODULES DISABLED? True
OS, Hosting, Browser (if applicable): Linux, Firefox, local
Short Description of bug: <a> links are removed if not text inside, this includes if there is just an img in that link
Simple steps to reproduce the bug:
Switch to html editing mode in a new page, and enter:

<p>
  <a href="assets/01-005.shield-bremen.png">
    <img src="assets/01-005.shield-bremen.png"/>
  </a>
</p>

When it saves it leaves only:

<p>
</p>

If however the link and img are outside a

tag then it leaves the img, but strips the link:

<a href="assets/01-005.shield-bremen.png">
    <img src="assets/01-005.shield-bremen.png"/>
  </a>

becomes:

<img src="assets/01-005.shield-bremen.png" style="">
@Fyorl Fyorl added the text-editor Issues related to the ProseMirror or legacy TinyMCE text editor label Sep 26, 2022
@Fyorl
Copy link
Contributor Author

Fyorl commented Sep 26, 2022

Block-level image links are easy enough to represent in the schema, but having them inline might be a challenge.

@aaclayton
Copy link
Contributor

I think we can view supporting block-level image links as a bugfix and view inline functionality as either a "wontfix" or as a "for future development".

@aaclayton aaclayton changed the title Unable to create image links in ProseMirror editor Support block-level anchor tags which wrap around an image element in the ProseMirror schema. Sep 26, 2022
@aaclayton aaclayton added the bug Functionality which is not working as intended label Sep 26, 2022
@aaclayton aaclayton added this to the Version 10 - Stable Patch 4 milestone Sep 26, 2022
@Fyorl Fyorl self-assigned this Sep 28, 2022
@Fyorl Fyorl closed this as completed Sep 29, 2022
@MrPrimate
Copy link

This is still happening in 10.287 where links are inside another tag, such as

as per the first example:

<p>
  <a href="assets/01-005.shield-bremen.png">
    <img src="assets/01-005.shield-bremen.png"/>
  </a>
</p>

becomes :

<p></p>

@Fyorl
Copy link
Contributor Author

Fyorl commented Oct 7, 2022

@MrPrimate Please see this comment #8275 (comment)

@MrPrimate
Copy link

Ah I misunderstood that comment - is there an issue for the inline functionality, or is this a "wontfix"?

@Fyorl
Copy link
Contributor Author

Fyorl commented Oct 7, 2022

It's mostly covered by #8130. Once we support inline image nodes, the existing link marks should apply to them without any extra work. So I think we can accommodate this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended text-editor Issues related to the ProseMirror or legacy TinyMCE text editor
Projects
No open projects
Development

No branches or pull requests

3 participants