Skip to content

Feature: Add validation in visual editor yaml frontmatter #744

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

vezwork
Copy link
Collaborator

@vezwork vezwork commented Jun 26, 2025

Working prototype!

Video of me showing a title: number error in the source editor and now also in the visual editor

Todo

  • use mock schema to test validation
  • use actual yaml frontmatter schema for validation
  • apply validation to yaml content on code block initialization
  • apply validation to yaml content on save on edit (and clear old underlines)
  • underline validation
  • show validation error message in popover when hovering underlined validation

Out of scope

  • figure out how to pipe existing LSP validation through to the visual editor. Instead, @cscheid came up with a shortcut to import and call the validator in the visual-editor front-end code-block code. It would probably be ideal to pipe it through (Maybe using custom LSP methods?) so we aren't calling the validator in multiple ways

@vezwork
Copy link
Collaborator Author

vezwork commented Jul 8, 2025

I found it difficult to figure out how to validate on-save, so I am validating on every edit right now. This should be tested for larger yaml front-matters in case it introduces latency or other issues. It should be easy to address any issues that come up: a quick fix would be to do something like a debounce on edit validation.

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