You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Problem
Code Block component is really useful, but since it's created not to be extended by the user it's hard to add a copy-to-clipboard functionality to the component (although you can change the icons, buttons, etc for language selector).
Solution
It would be handy to be able to add functionalities yourself (extend the components) or just support copy to the clipboard button.
Alternatives
Let users extend milkdown components and plugins
The text was updated successfully, but these errors were encountered:
I'm trying to copy the current selection as markdown.
theEditor.editor.action((ctx: Ctx)=>{consteditorView=ctx.get(editorViewCtx);letselection=editorView.state.tr.selection;// now what...?// I searched through `selection`'s fields, recursively,// but could not find a method to get the markdown. });
Perhaps, something like selection.getMarkdown() would solve mine and would subsume your code block copy?
Then it's just a matter of navigator.clipboard.write(), isn't it?
Initial checklist
Problem
Code Block component is really useful, but since it's created not to be extended by the user it's hard to add a copy-to-clipboard functionality to the component (although you can change the icons, buttons, etc for language selector).
Solution
It would be handy to be able to add functionalities yourself (extend the components) or just support copy to the clipboard button.
Alternatives
Let users extend milkdown components and plugins
The text was updated successfully, but these errors were encountered: