Links with styles creating multiple links

Sandbox example - If you hover over the link you’ll see it’s broken into three chunks.

In this example, the intent is that the link should be one item with various font stylings. At first I thought this might be to do with the new line, but if I take out the *'s and leave the new line in then it renders as a single link, as intended.

Is there a way of tweaking the output to make the link part greedier, essentially, and have it expand around the <em> tags? In the application we’re working on, we’ve attempted to increase the priority of the link over em, but it had no discernible affect. I thought a minimum example might make it easy for someone to point me at the right part of the docs, or straight up say “no can do”.

For comparison, the same markdown in the markdown-it demo works as intended, so I’m hopeful my markdown isn’t completely invalid.


How did you do that? Marks are wrapped in the order they appear in the schema definition (the priority field just sets parse rule priority). I think that making it so that links appear before emphasis in the mark object (which they do in prosemirror-schema-basic but not in prosemirror-markdown’s schema) should have the effect you want.

1 Like

Ah, that original sentence should probably read “we altered the priority value thinking it would help, but since it’s unrelated, it had no discernible effect”!

However, changing the order of the marks list did work, so we’re in business! Thank you!