javalent / admonitions

Adds admonition block-styled content to Obsidian.md
MIT License
1.04k stars 67 forks source link

[Code]: Sourcepath for getAdmonitionElement #314

Closed mayurankv closed 1 year ago

mayurankv commented 1 year ago

Scope

Currently, the getAdmonitionElement function renders markdown but returns an empty sourcePath so markdownPostProcessors get triggered but with no sourcePath context. This is an issue for postProcessors that wish to work with the admonitions plugin. I understand that the plugin renders things following this as well which do provide sourcePaths, but the getSectionInfo seems to only work on the render that returns an empty sourcePath.

If I'm misunderstanding why this should return an empty sourcePath, then apologies but if changing it to include a sourcePath isn't an issue, that would be greatly appreciated!

Discovery

Rather than returning '' to the sourcePath for the getAdmonitionElement function in main.ts line 424, return the actual sourcePath.

Validate

No changes should be required outside of this.