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

Unexpected behavior when adding link to image #3286

Open
helloagain-dev opened this issue Dec 11, 2024 · 0 comments
Open

Unexpected behavior when adding link to image #3286

helloagain-dev opened this issue Dec 11, 2024 · 0 comments
Labels

Comments

@helloagain-dev
Copy link

Summary

Unexpected behavior when adding link to image
This issue describes a problem encountered while using ToastUI Editor (v3.2.2) to insert links into images. When a link is added to an image, the editor inserts a span element with the class "image-link" between the image and the link elements. This structure causes issues when the resulting HTML is parsed by React Native, as the image becomes clickable but opens a preview instead of following the intended link.

Desired behavior:

  • Option to disable span insertion: Allow users to configure the editor to directly apply links to image elements without the intermediary span.
  • Improved compatibility with React Native: Ensure that the generated HTML is more easily parsed and rendered correctly by React Native.

Question
Is a pull request proposing the described behavior change a suitable course of action?

Version

3.2.2

Additional context

We are currently attempting to manage this issue on the React Native side of our stack. However, it would be beneficial if ToastUI Editor could provide an additional option during initialization to disable the insertion of the "image-link" span when linking images. This would streamline the integration process and prevent potential compatibility issues.

The bit of code that results in this behaviour is within the createElement function of the ImageView class:
tui.editor/apps/editor/src/wysiwyg/nodeview
/imageView.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant