artempyanykh / marksman

Write Markdown with code assist and intelligence in the comfort of your favourite editor.
MIT License
2.03k stars 35 forks source link

path extension and broken links #177

Open s-cork opened 1 year ago

s-cork commented 1 year ago

I'm using the vscode implementation.

I noticed that:

artempyanykh commented 1 year ago

Thanks for asking @s-cork!

internal link autocompletion adds the path ending e.g. [foo](foo.md) does it need to? can this be configurable?

By default we add .md because with inline links it's not clear when something is a reference to a document inside the workspace or not, and having the extension helps to resolve this ambiguity.

Right now there's no config option for inline links to skip the extension, although it's also not hard to add.

detecting broken internal links only works if the .md extension is added

This is for the reasons explained above. Marksman is conservative when it comes to inline links; it will report a problem only when it's sure that the link should point to a file inside the workspace.

I'd imagine we could have a config option that would flip the behavior and assume that everything should be a link to a file unless it's a full URL.

detecting broken internal references doesn't seem to be a thing

Are you talking about [foo] kind of reference links? For them there's no detection because you generally can't say if [foo] is supposed to be a link or just some text in brackets. However, if you use a collapsed form of reference links e.g. [foo][] then Marksman will report diagnostics.

s-cork commented 1 year ago

detecting broken internal references doesn't seem to be a thing

It seems even with [foo][] and a definition of

## References
[foo]: foo.md

breaking the link doesn't cause any syntax highlighting

artempyanykh commented 1 year ago

@s-cork hm, is it VSCode?

s-cork commented 1 year ago

yes VSCode

Lamby777 commented 8 months ago

Don't know if this is related or I'm just doing something wrong, but doing this:

For info on blah blah blah, see [Module 3](../xxxx/mod03.md)

gives a warning: 1. Ambiguous link to document '../xxxx/mod03.md' [1]

The only solution I found was doing that references thing they mentioned, but then I can't jump to the file using the LSP jump feature. Why is it considered ambiguous? I tried removing the .md, but that didn't work. I even tried using an absolute path, but that was even worse because it says the file just doesn't exist. I have multiple files in the workspace called mod03.md but they're in different folders... Why can't I just specify a path like this? ;-;