Codeblocks syntax highlighting and background
ErikMichelson opened this issue · comments
Description
Codeblocks (with fences) do not have a background-color. Thus it's harder to distinguish them from other text content.
Another effect hardening that problem is the fact that for certain languages the syntax-highlighting keywords do not match the autocomplete suggestion.
Steps to reproduce
Create a new note with the following content (ignore the backslashes) and view it both in light and dark mode in HD2. Compare it also with the results in HD1:
\```
test codeblock without background
\```
Invalid autocomplete suggestions:
\```ts
// ts vs typescript as language
const a = {
"a": -5
}: Record<string, number>;
const b = window.atob(JSON.stringify(a));
window.open(`https://hedgedoc.org/#x=${b}`)
\```
\```js=
// neither js nor javascript is suggested
const a = {
"a": -5
};
const b = window.atob(JSON.stringify(a));
window.open(`https://hedgedoc.org/#x=${b}`)
\```
Expected behaviour
Autocomplete suggestions should (only) include the languages that are supported by our rendering syntax highlighting.
Codeblocks should have a decent background color to distinguish them from the other content.
Logs
No response
Config
No response
Your Setup
- hedgedoc.dev
- Chrome 123, Ubuntu 23.10
Additional context
vs