-
Notifications
You must be signed in to change notification settings - Fork 53
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
Links in a list are not parsed #31
Comments
Hey @Jaspur, Thanks for bringing this to our attention! 🎉 I looked into it, by making a list on the Editor.js website, but the behaviour there seems identical. When you add a link to the list, it isn't automatically converted to an The JSON also represents this, as I made the first item a link via the Editor.js config menu. {
"type" : "list",
"data" : {
"style" : "ordered",
"items" : [
"<a href=\"https://google.com\">https://google.com</a>",
"https://bing.com",
"https://cake.co.uk"
]
}
} There are three ways to solve this:
Something like this might work: <div class="editor-js-block">
{{ ($style == 'unordered') ? '<ul>' : '<ol>' }}
@foreach ($items as $item)
<li>
- {{ $item }}
+ @if (filter_var($item, FILTER_VALIDATE_URL))
+ <a href="{{ $item }}" rel="noopener" target="_blank">{{ $item }}</a>
+ @else
+ {{ $item }}
+ @endif
</li>
@endforeach
{{ ($style == 'unordered') ? '</ul>' : '</ol>' }}
</div> TL;DR: It's not supported out-of-the-box by Editor.js, but a custom view might work. |
Hi, thanks, but why isn't this supported out of the box then? ;-) Looks pretty normal behavior. |
I really don't know. You'd think that when you type Edit: I do believe that this should be client-side behaviour. Turning every link in an anchor might be a security issue. |
Since we can't really do anything about this, I'm closing this issue. I'll try to fit in some time to get those custom blocks working, and then add a helper for the |
But it is different by the way, because my list-items are not just url's: https://www.dropbox.com/s/tuucryikeh9vx1y/Schermafdruk%202019-11-17%2020.50.56.png?dl=1 |
Same issue is for using links in Tables.. |
Again, this is because automatic link recognition is not built into Editor.js. |
Hello, I have the same problem, links are not parsed on list elements. Is this still a bug ? |
Hey,
I have a unsorted list with text on each line, all beginning with a link at the first word. But the links aren't parsed when generating HtmlOutput.. Also not in the show-modus in Nova.
The text was updated successfully, but these errors were encountered: