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 when clicking on frontmatter tags and keywords #4517

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

Conversation

UFOMelkor
Copy link
Contributor

Description

Triggers a change when a keyword or a tag in YAML Frontmatter is clicked.

Changes

I could not get it working with simple using the information from the frontmatter-parser because the nodes were neither accessible nor hierarchical. I looked at the implementation of version 2.3 and stole the idea to use the YAML parser. It works so far, but it won't help for implementing the autocompletion for tags and keywords, where the same problem will occur.

Additional information

Resolves #4498

Tested on: Ubuntu 22.04

@nathanlesage
Copy link
Member

So, first of all sorry for answering this late. This still seems a bit hacky to me, but to be honest I don't yet have a good other way. Maybe wrapping up the entire Frontmatter in its own node…? Then we could check if the clicked position is somewhere in there, then just parse the entire chunk with YAML and retrieve the node at the given position (the YAML parser retains quite a lot of info, fortunately).

I don't want to include that in 3.0.0 stable yet, because I'm afraid there might be things breaking, but I feel you showed something very valuable here that should be included asap afterwards!

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.

Keywords YAML does not work in 3.0 beta 6
2 participants