-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add Markdown support to the Note node #2044
Conversation
This uses the [Tiptap](https://tiptap.dev) rich text editor to add Markdown support for the Note node. All the usual Markdown features are supported, with the exception of links.
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please attach screenshots/video clips and explain how this widget should function, e.g. how does the feature switch between edit mode and view mode.
Here's a screen recording. There's no separate edit/view modes, it works just the same as before, you just click in the text area and start typing. Markdown-demo.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently if we paste markdown text to the textarea, it is not detected as markdown. Can you fix it? Or I would suggest we have some sort of switching mechanism, i.e. double click textarea to enter edit mode where raw text is shown, and unfocus will show the rendered markdown.
Instead of using the rich-text editing functionality, when you click on the Markdown widget to edit it, it switches to a plain textarea. When it loses focus, it switches back to the rendered Markdown view. Also adds link support. `rel="noopener noreferrer nofollow"` is added by default.
I've added an edit mode that switches to editing raw Markdown. You should be able to paste Markdown in there. I've also added link support. Markdown-demo-2.mp4 |
Is it me or the markdown support doesn't support rendering tables? @gremlation |
Is this necessary @alessandroperilli? There's all sorts of things that could be added (code highlighting, task lists, YouTube embeds, etc.), but I was trying to strike a balance between the things people will actually use and throwing the kitchen sink in. If this is something you think people will use, I've opened a pull request for table support in #2072 |
@gremlation personally, I use them inside APW. I'd be fine without markdown support for tables, but the problem is that without it, my "homemade tables in plain text" are screwed. So either we go for a modality switch, like MTB's Note+ node does, or I'd like support for them. As a side node, I also have issues with headings. Somehow, I cannot place 2 headings of the same time in the same node. I have this issue with both # and ## headings. |
Okay, cool. The pull request is there then. I just tried the MTB Note+ node and it doesn't work for me at all. Not sure what the problem is. When you say you have problems with the headings, do you mean with this Note node? It's working for me without a problem. Maybe it's a conflict with another extension? If you think it's a bug and can reproduce it without other extensions enabled, create an issue with debug info like browser version and tag me in it. Markdown-multiple-headings.mp4 |
FYI, this is creating backwards compatibility issues for all Notes that have single line breaks because of Markdown render: Screen.Recording.mov |
In my opinion, this should be a new node called "Markdown Note" |
Creating an issue here #2146 |
This uses the (MIT licensed) Tiptap rich text editor to add Markdown support for the Note node. All the usual Markdown features are supported.
┆Issue is synchronized with this Notion page by Unito