A Way to Export Your Note to Markdown Elegantly (NO IMAGES BROKEN) #4930
wold9168
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The export functionality in Trilium actually has quite a few issues, especially when it comes to exporting notes as Markdown. We may find that if the exported notes include images, the image filenames might get truncated due to excessive length. For example:
18 - Thursday_IMG_20240718_205335.jp
. Moreover, spaces in the note titles (which become part of the image path) can cause the exported Markdown file to fail rendering due to renderer limitations.In short, the feature of exporting notes as Markdown in Trilium doesn't work well, because many Markdown renderers do not handle image path names with spaces well, and they may also misinterpret the file extensions. But the images attached to the Markdown files exported by Trilium are exactly like that — with spaces in the file paths and potentially problematic extensions.
However, I have found a great workaround for this issue.
The method is very simple—we can first export the notes as HTML, and then use pandoc to convert them into Markdown format.
Please note, we need to use the parameter
-f html -t markdown_github-raw_html
. Using the default -t html will result in some complex formats from the HTML also being converted, which is not ideal.Beta Was this translation helpful? Give feedback.
All reactions