question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Links should be marks instead of inline nodes

See original GitHub issue

Currently 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:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ianstormtaylorcommented, Jul 28, 2016

@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.)

1reaction
tyler-johnsoncommented, Jul 28, 2016

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 and Inline.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found