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
When I export a note with code blocks into markdown, the code blocks are indented rather than fenced with ```, along with the header style using setext than the atx style, which will be rendered normally in most markdown renderers. However, I still want the atx headers and fenced code blocks as my writing favor.
After inspecting the source code, I figure out that the markdown exporter utilizes turndown, and the export behavior can be tweaked by some options. So I made some changes to the src/services/export/md.js as followed.
--- a/src/services/export/md.js+++ b/src/services/export/md.js@@ -7,7 +7,7 @@ let instance = null;
function toMarkdown(content) {
if (instance === null) {
- instance = new TurndownService();+ instance = new TurndownService({ codeBlockStyle: 'fenced', headingStyle: 'atx' });
instance.use(turndownPluginGfm.gfm);
}
After recompiling the docker image, I can totally export notes into markdown files with fenced code blocks and atx style headers. Therefore, I wonder if it's possible to add some option entries to adjust exporting style.
P.S. thanks for your great job!
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Describe feature
When I export a note with code blocks into markdown, the code blocks are indented rather than fenced with ```, along with the header style using setext than the atx style, which will be rendered normally in most markdown renderers. However, I still want the atx headers and fenced code blocks as my writing favor.
After inspecting the source code, I figure out that the markdown exporter utilizes turndown, and the export behavior can be tweaked by some options. So I made some changes to the
src/services/export/md.js
as followed.After recompiling the docker image, I can totally export notes into markdown files with fenced code blocks and atx style headers. Therefore, I wonder if it's possible to add some option entries to adjust exporting style.
P.S. thanks for your great job!
Additional Information
No response
The text was updated successfully, but these errors were encountered: