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

Text-Editor, External and Internal Link handling #3903

Closed
thebestgin opened this issue Jun 10, 2021 · 4 comments
Closed

Text-Editor, External and Internal Link handling #3903

thebestgin opened this issue Jun 10, 2021 · 4 comments

Comments

@thebestgin
Copy link

thebestgin commented Jun 10, 2021

Hi,

I use the Text Editor more and more often.
This one works great overall.

I hope I have not overlooked the following feature so far.
An optimization is what I would like to see.
When using a link, I often miss the option, if the link is an internal link for Framwork7 or an external link.
External links should not run through the router.
In Framework7 is used for the component Link the class "external" for it in combination with _blank, _self

The feature could be used like this.
Linkinput
image
{external:_blank}https://framework7.io/svelte/link.html
With the first part you can add the Framwork7 classen and attributes for the link.

Only as a suggestion.

@nolimits4web
Copy link
Member

Good idea, will add some support for adding custom attributes to link and image

@thebestgin
Copy link
Author

thebestgin commented Jun 26, 2021

I've been thinking about how to make the feature nice to use from a user perspective.

The calendar gets a additional property. These property contains filters. With the filters Framework7 finds out what are internal links and what are external links. If a url starts with "https://framework7.io/" then it is an internal link. Everything else is an external link. Maybe you can also work with regex here.

This would have the great advantage that the logic is not in the editor content.

@nolimits4web
Copy link
Member

Ok, so not to mess with formats, I think it is better to leave it to developer to decide. So now (with next release), editor will have insertLink and insertImage events, and based on these, you now can detect when link/image was added and post process the HTML/value

@thebestgin
Copy link
Author

thebestgin commented Jul 13, 2021

Ok, so not to mess with formats, I think it is better to leave it to developer to decide. So now (with next release), editor will have insertLink and insertImage events, and based on these, you now can detect when link/image was added and post process the HTML/value

This is the best solution. 👍
Thanks a lot for this feature.

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

No branches or pull requests

2 participants