Feature request: Copy all markdown block content
In many cases I write my content in Markdown, and therefor I almost never need multiple blocks in the Gutenberg editor. Would it be possible to create a keyboard shortcut or a menu item from the options menu where all content from the Markdown block(s) can be copied to the clipboard.
This is especially useful when the first heading on level 1 (often marked by one number-sign #) then I could easily copy and paste markdown between my editor of choice and the Wordpress interface without creating unwanted empty blocks.
Hi - I'm afraid I'm not clear what you're asking for here. Could you give me a step by step example of what you want to do and what you would expect to happen.
Thanks.
Hi, of course
Since the block editor became the default in Wordpress 5.0 everything is put inside blocks.
When I wrote blogposts or other content I used Markdown quite extensively, and still do in an editor on my computer, and often I write while I am traveling and have no internet access.
If I ever change something in a post/page in Wordpress, after I have copied the Markdown to the block-editor I can not as easy copy this back to my text editor.
In the post screen there is an options menu, and if you click this there is an option called "Copy all content". If this is clicked all content is copied, but this will mix the block editor syntax with the Markdown syntax, so the result is like this: Source:
Title: Copy all content
## Here is a heading which I wrote in the Markdown block
Here is a paragraph. And here is a list.
* This is the first item.
* This is the second item.
* This is the third item.
After copying via copy all content I get this result:
<!-- wp:toolbelt/markdown {"source":"## Here is a heading which I wrote in the Markdown block\n\nHere is a paragraph. And here is a list.\n\n* This is the first item.\n* This is the second item.\n* This is the third item.\n"} -->
<div class="wp-block-toolbelt-markdown"><h2 id="here-is-a-heading-which-i-wrote-in-the-markdown-block">Here is a heading which I wrote in the Markdown block</h2>
<p>Here is a paragraph. And here is a list.</p>
<ul>
<li>This is the first item.</li>
<li>This is the second item.</li>
<li>This is the third item.</li>
</ul>
</div>
<!-- /wp:toolbelt/markdown -->
As you see from the result above the copied Markdown gets mixed with the HTML, and it would be nice if there was an option to copy all content as Markdown so the source would be retained without the HTML.