outline / rich-markdown-editor

The open source React and Prosemirror based markdown editor that powers Outline. Want to try it out? Create an account:
https://www.getoutline.com
BSD 3-Clause "New" or "Revised" License
2.87k stars 590 forks source link

Hyperlinks are posted between < >'s #608

Closed icellan closed 2 years ago

icellan commented 2 years ago

To Reproduce Paste a link into the editor. Link is pasted as "\https://......\", with < > brackets

Expected behavior Link is either pasted as clear text or as a Markdown link [title](URL)

Version 11.19.4

tommoor commented 2 years ago

Hey – this is expected behavior and differentiates links that were made by the user and those that were auto-linked. Not using clear text allows having url-like objects in the text that are not linked in the editor.

<> is valid link syntax in the majority of markdown parsers (there is no official spec)

icellan commented 2 years ago

@tommoor Thanks for the feedback. Is there some way to overwrite the way this is done? ATM I am replacing this with regex.

tommoor commented 2 years ago

This is the code you'd need to edit:

https://github.com/outline/rich-markdown-editor/blob/main/src/marks/Link.ts#L146-L160