microsoft / microsoft/monaco-editor
[Bug] json code block in markdown has no highlight
Open
Nobody has claimed this yet.
bug
json
tokenization
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
// Through the options literal, the behaviour of the editor can be easily customized.
// Here are a few examples of config options that can be passed to the editor.
// You can also call editor.updateOptions at any time to change the options.
var editor = monaco.editor.create(document.getElementById("container"), {
value: '# aaaa\n\n\n{\n "type": "object",\n "properties": {\n "aaa": {\n "type": "string",\n "description": "bbb"\n }\n }\n}\n',
language: "markdown",
lineNumbers: "off",
roundedSelection: false,
scrollBeyondLastLine: false,
readOnly: false,
theme: "vs-dark",
});
setTimeout(function () {
editor.updateOptions({
lineNumbers: "on",
});
}, 2000);
Reproduction Steps
Use json code block in markdown editor
Actual (Problematic) Behavior
there is no highlight for json code block in markdown editor
Expected Behavior
highlight for json code block in markdown editor should be exist
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the linked Monaco Editor Playground and reproduce the missing highlighting in a Markdown editor using the supplied code. Investigate the Markdown editor behavior for JSON code blocks, then verify that JSON content receives syntax highlighting without changing the reported reproduction conditions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100