Don't parse checkboxes are links in markdown (#150914)

Fixes #150672
This commit is contained in:
Matt Bierner
2022-05-31 14:57:32 -07:00
committed by GitHub
parent 3c6fdedd0e
commit e6fff5ecff
4 changed files with 62 additions and 0 deletions

View File

@@ -268,4 +268,17 @@ suite('markdown: Diagnostics', () => {
const { diagnostics } = await manager.recomputeDiagnosticState(doc1, noopToken);
assert.deepStrictEqual(diagnostics.length, 0);
});
test('Should not detect checkboxes as invalid links', async () => {
const doc1 = new InMemoryDocument(workspacePath('doc1.md'), joinLines(
`- [x]`,
`- [X]`,
`- [ ]`,
));
const contents = new InMemoryWorkspaceMarkdownDocuments([doc1]);
const manager = createDiagnosticsManager(contents, new MemoryDiagnosticConfiguration(true, ['/doc2.md']));
const { diagnostics } = await manager.recomputeDiagnosticState(doc1, noopToken);
assert.deepStrictEqual(diagnostics.length, 0);
});
});