-
Notifications
You must be signed in to change notification settings - Fork 13
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
YAML support #84
Comments
yes it's on the radar - there isn't a modern cm6 mode for yaml last we checked, but it's still possible with legacy mode i think |
There is now! https://github.com/codemirror/lang-yaml |
FYI I've picked this up. Will see how easy it is to add a yaml mode. |
Merged
imolorhe
added a commit
that referenced
this issue
Feb 23, 2024
Closes #84 - Added YAML support - Also updated the DOM rendering bits to use markdown instead of setting the HTML directly, which is a safer approach - Also slightly improved the demo UI (it didn't look good with black text on black background) - Also added a bunch of tests To support YAML (and potentially other formats), I updated the logic to "resolve" tokens before using them. This is important since the [YAML grammar/tokens](https://github.com/lezer-parser/yaml/blob/main/src/yaml.grammar) is different from the [JSON grammar/tokens](https://github.com/lezer-parser/json/blob/main/src/json.grammar) (which is very similar to the [JSON5 grammar](https://github.com/dimfeld/lezer-json5/blob/master/src/json5.grammar)). So we map the tokens from the different grammars to the equivalent token in the "base" grammar (currently this is the JSON grammar tokens but I think we can/should map to some other arbitrary token set which will force us to properly implement the mappings, otherwise additional changes made may work in JSON mode but without proper testing, may not work in YAML mode, if the mappings were not added).
github-project-automation
bot
moved this from Backlog
to Done
in codemirror-json-schema roadmap
Feb 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you considered adding support for YAML?
The text was updated successfully, but these errors were encountered: