Showing "missing file" links
I accidentally messed up a markdown link by pasting a full link where the bare link should have been:
[Why Hamilton is as frustrating as it is brilliant -- and impossible to pin down]([Hamilton on Disney+: Why we'll never stop fighting about this brilliant, frustrating musical - Vox](https://ktxc.to/hamilton-slippery))
I recognize that this doesn't show up as an error when validating external links because it's an external link. But when I hover over the link in Marked, it knows it is a problem "missing file" (because it tells me so). But there is no visual or other indicator other than that shown when I hover.
It feels like this should show up in some proofing tool or mode. Or does it and I am just missing it?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 20 Jul, 2020 03:19 PM
Which processor are you using? With MMD and Preferences->Proofing->Highlight Markdown syntax errors enabled, you should see a red outline.
Doesn't work as well the way that Discount (GFM) renders it, but it should still be pretty obvious where an error is:
Can you show me how it's rendering on your end?
-Brett
2 Posted by chris on 20 Jul, 2020 03:55 PM
I'm using the Multimarkdown processor with Highlight Markdown Syntax erros checked. Attached is what I see with proofing on and the Swiss style sheet (if that makes a difference) with the problematic part in context (which might also make a difference, though even the minimal example I shared doesn't flag a problem on my end) no indication there is a problem) ... this is obviously item #4 :)
I only see that there's a missing file if I hover over the link that otherwise doesn't show a problem.
I'm also attaching the full markdown file.
Support Staff 3 Posted by Brett on 20 Jul, 2020 04:11 PM
On my end, your Markdown definitely renders as shown in my original
screenshot, with the obviously-bad link showing up as malformed. I'm not
sure why your processor is turning that into any kind of valid link and
mine isn't.
In answer to the question, though, Marked's link checking has two
separate parts. The "Validate Links" feature scans only for 'http' urls
and looks for response codes from visiting those urls. The link hover,
on the other hand, will recognize a file link and do a quick request to
the filesystem to get info on the linked file. But that functions
separately from url validation. I _could_ feasibly add filesystem checks
to the Link Validation feature, but there are many cases where links in
a document aren't expected to work at the time of rendering, and are
instead placeholders or fragment links, which makes it harder to
universally determine that a link is bad.
In your particular case, the processor should be leaving the square
brackets and parens in the final output, which Marked _does_ recognize
as the result of a malformed link. Again, I'm not immediately certain
why you're not seeing that happen. Because it's generating a valid HTML
`<a>` tag for it, it's not triggering Marked's detection of the
malformed link. Like I said, I loaded your provided Markdown using the
MMD processor and did _not_ get the same result as you, so I'm going to
have to do some digging to see if I can replicate.
Is there any chance you have a Custom Processor running?
-Brett
4 Posted by chris on 20 Jul, 2020 04:24 PM
That was it! At some point in the distant past I set up a custom processor (I don't remember why):
I turned that off and voila! Sorry for taking up your time; I really should have though to check that.
Added: it makes complete sense to me not to have file checks happening with the link validation!
Support Staff 5 Posted by Brett on 20 Jul, 2020 05:16 PM
No problem!
-Brett