Skip to content

Export markdown without extra line breaks #628

Answered by windingwind
macrospecter asked this question in Q&A
Discussion options

You must be logged in to vote

The line break is an allowed syntax of markdown - the problem here is just obsidian does not render it correctly (I guess, because my vscode ignores these empty lines when rendering)

The template share code that removes empty lines between both numbered/bullet lists:

# This template is specifically for importing/sharing, using better 
# notes 'import from clipboard': copy the content and
# goto Zotero menu bar, click Edit->New Template from Clipboard.  
# Do not copy-paste this to better notes template editor directly.
name: "[ExportMDFileContent]"
content: |-
  ${{
  	let lines = mdContent.split("\n");
  	function isListLine(line) {
  		return /^(?:\*|-|\+|[0-9]+\.)(?= )/.test(line.trim());

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by windingwind
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #620 on August 12, 2023 01:36.