Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow embedding only a section of a document. #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jkunczik
Copy link

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@8c7542b).

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.

When trying to embed sections, the renderer fails, because the path of the document to embed can't be found. This commit fixes that and only includes the referenced section. (Analog to: jkunczik/obsidian-copy-as-html@8c7542b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant