Links should be marks instead of inline nodes
See original GitHub issueCurrently in the examples (https://github.com/ianstormtaylor/slate/blob/master/examples/links/state.json#L12), links are inline nodes.
I think, similar to Prosemirror, links should be marks, so that the user can click the Link
button, enter an href
and start typing (similar to Google Docs or other editor) (link
will be added to cursorMarks
).
Maybe it’s already possible, then examples should be adapted.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Prevent marks from breaking up links - Discuss - ProseMirror
Is there any way to promote links so that inner marks do not ... Is the solution to use an inline node instead...
Read more >Inline elements - HTML: HyperText Markup Language | MDN
Inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the...
Read more >Nodes - Slate
You can define which nodes are treated as inline nodes by overriding the editor.isInline function. (By default it always returns false .) Note...
Read more >Bundle inlining - Parcel
This means if the inline bundle contains code, it will be executed in the parent bundle rather than returning a string to the...
Read more >setOptions - Marked Documentation
baseUrl, string, null, 0.3.9, A prefix url for any relative link. ... You can parse inline markdown by running markdown through marked.parseInline ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tyler-johnson I use that distinction mentally too, but I was thinking that there might not be a reason to limit mark rendering to an object of styles. I think it would be possible to let people render them as component, so you could implement hover effects or similar! (Doesn’t affect this question, but food for thought for later.)
I was under the impression that marks only set styling in the range and don’t affect the tagnames or attributes. To me that is solid separation between
Mark
andInline
.I do find it strange that Prosemirror allows links to be separated by paragraphs. I’m not sure when a user of the WYSIWYG would desire that functionality, but then again stranger things have happened.
Quill has something similar called “formats” where you can add inline elements arbitrarily over several other inlines or elements. The result? A horrible mess of tangled code riddled with edge cases. I think creating a clear separation that relies on the DOM for “design inspiration” is going to result in a cleaner solution that works more reliably.