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

Search results displayed in the middle of frontmatter #16

Open
marconoris opened this issue Nov 15, 2023 · 2 comments
Open

Search results displayed in the middle of frontmatter #16

marconoris opened this issue Nov 15, 2023 · 2 comments

Comments

@marconoris
Copy link

marconoris commented Nov 15, 2023

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...

@rcherny
Copy link

rcherny commented May 5, 2024

This #16 seems to be a duplicate of #17.

@rcherny
Copy link

rcherny commented May 5, 2024

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))

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

No branches or pull requests

2 participants