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

fix: ensure syntax blocks for ebnf are marked as such #16837

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

ckipp01
Copy link
Member

@ckipp01 ckipp01 commented Feb 6, 2023

I see that this was done in the past in
https://github.com/lampepfl/dotty/pull/14958/files, but then reverted in
#14958. Like many commits, there
really isn't an explanation of the revert, but from reading between the
lines I assume the ; was the actual issue, not the syntax
highlighting. As it was pointed out, syntax.js doesn't actually support
ebnf. They do say they support bnf, but that didn't really work when I
was testing. Either way, this pr makes sure that we do mark the
snippets as ebnf. The reason for this isn't necessarily so that we
get syntax highlighting for these, but so that syntax.js doesn't infer
the wrong type of syntax and provide odd highlighting like we currently
have. This also helps to ensure screen readers know what type of
codeblock this is.

fixes #14697

I see that this was done in the past in
https://github.com/lampepfl/dotty/pull/14958/files, but then reverted in
scala#14958. Like many commits, there
really isn't an explanation of the revert, but from reading between the
lines I assume the `;` was the actual issue, not the syntax
highlighting. As it was pointed out, syntax.js doesn't actually support
`ebnf`. They do say they support `bnf`, but that didn't really work when I
was testing. Either way, this pr makes sure that we _do_ mark the
snippets as `ebnf`. The reason for this isn't necessarily so that we
_get_ syntax highlighting for these, but so that syntax.js doesn't infer
the wrong type of syntax and provide odd highlighting like we currently
have. This also helps to ensure screen readers know what type of
codeblock this is.

fixes scala#14697
@ckipp01 ckipp01 merged commit f37c213 into scala:main Feb 7, 2023
@ckipp01 ckipp01 deleted the ebnf branch February 7, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: broken highlighting in syntax summary for "
2 participants