mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Fixing some html tags detected as autolinks for diagnostics (#149511)
For markdown such as `<scope:tag>b</scope:tag>`, we currently detect `<scope:tag>` as an uri (an autolink) and then try validating it as a file path This change doesn't fix `<scope:tag>` being detected as a link (which is actually correct if there isn't closing html), but does fix the us trying to validate it by marking the uri as external
This commit is contained in:
@@ -158,4 +158,23 @@ suite('markdown: Diagnostics', () => {
|
||||
const diagnostics = await manager.getDiagnostics(doc1, noopToken);
|
||||
assert.deepStrictEqual(diagnostics.length, 0);
|
||||
});
|
||||
|
||||
test('Should not generate diagnostics for email autolink', async () => {
|
||||
const doc1 = new InMemoryDocument(workspacePath('doc1.md'), joinLines(
|
||||
`a <user@example.com> c`,
|
||||
));
|
||||
|
||||
const diagnostics = await getComputedDiagnostics(doc1, new InMemoryWorkspaceMarkdownDocuments([doc1]));
|
||||
assert.deepStrictEqual(diagnostics.length, 0);
|
||||
});
|
||||
|
||||
test('Should not generate diagnostics for html tag that looks like an autolink', async () => {
|
||||
const doc1 = new InMemoryDocument(workspacePath('doc1.md'), joinLines(
|
||||
`a <tag>b</tag> c`,
|
||||
`a <scope:tag>b</scope:tag> c`,
|
||||
));
|
||||
|
||||
const diagnostics = await getComputedDiagnostics(doc1, new InMemoryWorkspaceMarkdownDocuments([doc1]));
|
||||
assert.deepStrictEqual(diagnostics.length, 0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user