obsidian-wikipedia
obsidian-wikipedia copied to clipboard
Search results displayed in the middle of frontmatter
Hi,
there is an issue when plugin publish search results in note: it put results in the middle of frontmatter and not in cursor location...
This #16 seems to be a duplicate of #17.
Looking at the code, it seems like possibly it is inserted to actually replace the selection:
https://github.com/jmilldotdev/obsidian-wikipedia/blob/master/main.ts#L165
editor.replaceSelection(this.formatExtractInsert(extract, searchTerm));
From testing, this does seem to resolve the problem.
If you put in your heading, and then the place where you want the content to be injected, it replaces. Example:
# Obsidian
content (select this text)
Result:
# Obsidian
> Obsidian is a personal knowledge base and note-taking software application that operates on Markdown files. It allows users to make internal links for notes and then to visualize the connections as a graph. It is designed to help users organize and structure their thoughts and knowledge in a flexible, non-linear way. The software is free for personal use, with commercial licenses available for pay.
>
> [Wikipedia](https://en.wikipedia.org/wiki/Obsidian%20(software))