obsidian-pandoc icon indicating copy to clipboard operation
obsidian-pandoc copied to clipboard

Allow embedding only a section of a document.

Open jkunczik opened this issue 1 year ago • 0 comments

Thanks for this plugin! I found a little bug:

When trying to embed sections, the renderer fails, because the path of the document to embed can't be found (due to the "#{section-name}" suffix).

This commit fixes that and only includes the referenced section (analog to: jkunczik/obsidian-copy-as-html@8c7542b84493452bd68a9e7dfd2931dbd5dc2a98).

Changes:

  1. Before trying to load the embedded file, split its name into the file and section part.
  2. If the embedding links to a section, extract only the section from the complete markdown file using regular expressions.

jkunczik avatar Mar 11 '23 21:03 jkunczik