microsoft / vscode-markdown-languageservice

The language service that powers VS Code's Markdown support, extracted so that it can be reused by other editors and tools
MIT License
408 stars 11 forks source link

"No link definition found" for footnotes #8

Open dtinth opened 2 years ago

dtinth commented 2 years ago

When I use footnotes^fn1, the language server generates a warning.

image

Here’s a repro, put this is src/test/diagnostic.test.ts:

    test('Should not generate diagnostic for valid footnotes', withStore(async (store) => {
        const doc = new InMemoryDocument(workspacePath('doc.test.md'), joinLines(
            `footnotes should work[^fn1]`,
            ``,
            `[^fn1]: this is a footnote`,
        ));

        const workspace = store.add(new InMemoryWorkspace([doc]));

        const diagnostics = await getComputedDiagnostics(store, doc, workspace);
        assertDiagnosticsEqual(diagnostics, []);
    }));
mjbvz commented 2 years ago

Footnotes aren't part of CommonMark so this is expected

They are common enough that I'd be open to adding support for them, but that should be something the library consumer has to opt into

hellt commented 1 year ago

I second that, footnotes are awesome and it'd be great for vscode markdown services to parse them accordingly

mail2nnv commented 1 year ago

+ my vote for footnotes