Skip to content

Fix YAML validation in cell metadata #12151

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

Merged
merged 7 commits into from
Feb 28, 2025
Merged

Fix YAML validation in cell metadata #12151

merged 7 commits into from
Feb 28, 2025

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Feb 25, 2025

On windows, this does not fail and should

---
title: "YAML intelligence should fail with knitr engine"
---

```{r}
#| echo: 123
1 + 1
```

And possibly using more backtick should fail always, and it is not

---
title: "YAML intelligence should fail with knitr engine"
engine: julia
---

This code cell has more than default 3 backticks

````{julia}
#| echo: 123
1 + 1
````

@cderv cderv marked this pull request as draft February 25, 2025 13:30
@cderv
Copy link
Collaborator Author

cderv commented Feb 25, 2025

@cscheid This PR also add some basic YAML validation for engine: julia doc. It seemed we did not have some, even basic.

@MichaelHatherly @jkrumbiegel Just a heads up that when this PR is merged, YAML option syntax in cell will be now validated

Document with non valid option like

---
title: "YAML intelligence should fail with knitr engine"
---
```{julia}
#| echo: 123
1 + 1
```

will now error.

Other engine have some specific schema tag that allows to filter out specific schema. Example

If there are some specific options to support, this needs to happen in those schema files - Open a PR and I'll help.

@MichaelHatherly
Copy link
Contributor

Thanks for the heads up @cderv, there will be some that'll need to be added for QNR. I'll open a PR when I have a chance to.

[skip ci]
@cderv cderv marked this pull request as ready for review February 25, 2025 16:21
@cderv cderv merged commit cdb794f into main Feb 28, 2025
47 checks passed
@cderv cderv deleted the fix/windows/yaml-validation branch February 28, 2025 10:38
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.

2 participants