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

Clicking on an image with a link in the editor opens the page in Foundry with no way to get back #8617

Closed
2 of 6 tasks
mattexdee opened this issue Dec 12, 2022 · 2 comments
Closed
2 of 6 tasks
Assignees
Labels
bug Functionality which is not working as intended journal Issues related to the Journal and Pages systems text-editor Issues related to the ProseMirror or legacy TinyMCE text editor

Comments

@mattexdee
Copy link
Contributor

What happened?

A ProseMirror editor with an image wrapped in an a tag will open the link in Foundry VTT replacing Foundry VTT.

linked-image-bug.webm

What ways of accessing Foundry can you encounter this issue in?

  • Native App (Electron)
  • Chrome
  • Firefox
  • Safari
  • Other

Reproduction Steps

  1. Open a Journal Entry Page with a Prose Mirror Editor
  2. Add an image and link it like <a href="https://google.com"><img src="some/path/to/art.webp"></a>
  3. Click on the image in the editor

What core version are you reporting this for?

V10.291

Relevant log output

No response

Bug Checklist

  • The issue occurs while all Modules are disabled
@mattexdee mattexdee added bug Functionality which is not working as intended journal Issues related to the Journal and Pages systems labels Dec 12, 2022
@mattexdee mattexdee added this to the Version 10 - Leftovers milestone Dec 12, 2022
@aaclayton
Copy link
Contributor

aaclayton commented Dec 12, 2022

@Fyorl we should probably adjust the prose-mirror schema to automatically include target="_blank" in HTML anchor elements?

@aaclayton aaclayton added the text-editor Issues related to the ProseMirror or legacy TinyMCE text editor label Dec 12, 2022
@Fyorl
Copy link
Contributor

Fyorl commented Dec 12, 2022

@Fyorl we should probably adjust the prose-mirror schema to automatically include target="_blank" in HTML anchor elements?

We do have Game#_onClickHyperlink which globally catches hyperlink clicks and gives them target="_blank". It skips links within a ProseMirror instance though to fix an issue where they would still be activated if you click them while editing (when the intention was to edit the link in some way, not follow it). So we probably need to be a bit more specific with that logic.

@Fyorl Fyorl self-assigned this Apr 18, 2023
@Fyorl Fyorl closed this as completed Apr 19, 2023
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 journal Issues related to the Journal and Pages systems text-editor Issues related to the ProseMirror or legacy TinyMCE text editor
Projects
Status: Done
Development

No branches or pull requests

3 participants