microsoft / microsoft/monaco-editor
[Bug] incorrect hightlight of markdown code when an image is a link
Open
Nobody has claimed this yet.
- 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
const value = `[](./x.html)`;
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "markdown",
automaticLayout: true,
});
Reproduction Steps
No response
Actual (Problematic) Behavior
the [![ and the ]] mismatched.
Expected Behavior
correctly highlight the code
Additional Context
When I was trying this on vscode.dev, it was not doing highlight at all.
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
Start with the linked Monaco Editor Playground reproduction and run the embedded TypeScript example using the markdown language. Compare highlighting for [](./x.html) with the reported mismatched brackets, then verify that image links are highlighted correctly without regressing ordinary markdown links.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100