[Feature Request] Highlight invalid links in red #1974
Replies: 6 comments
-
Hey, this is a cool idea. There isn't much we'd be able to reasonably to about "invalid" external links to valid URLs (i.e.
It sounds like you are inspired by how Wikipedia works, where red links are for pages that do not exist. I'm not sure how Wikipedia handles "invalid" links, as I would not call a link to a page that doesn't exist invalid, personally. If someone were interested in picking up this feature work, I'd be happy to provide feedback on pull requests or discuss more on this issue. 👍 |
Beta Was this translation helpful? Give feedback.
-
As far as I can understand from the code, this is done for the Gollum-specific double-bracketed link syntax (for example
Great ideas a well! 👍 |
Beta Was this translation helpful? Give feedback.
-
It does indeed work with the gollum specific syntax. In the article view and in the preview as well. |
Beta Was this translation helpful? Give feedback.
-
Indeed! Gollum has no control over the way different markup rendering libraries render links, so we can't make them check whether pages exist. I think any other solution would require checking each link and seeing whether it is a valid page (or a redirect to |
Beta Was this translation helpful? Give feedback.
-
The best I could think of so far was the following: Define an HTTP API endpoint that would take a list of unique document paths and return a bit array where the values depend on whether the corresponding file exists or not. Use that from Javascript to recolor the links asynchronously, batching the paths in as many chunks as needed to find the right balance between speed and UI responsiveness. Lots of flickering and inefficiency to expect, but still better than nothing, and relatively uninvasive. |
Beta Was this translation helpful? Give feedback.
-
Converted this to a discussion since we're getting further away from a simple Feature Request. From my perspective, the kind of solution @guillaume-d proposes introduces maintenance costs and possible performance issues that may perhaps simply not be worth it, given the support for gollum specific syntax that already exists. But if this a feature others feel very strongly about, please feel free to elaborate. |
Beta Was this translation helpful? Give feedback.
-
Currently when viewing or editing an article invalid links look identical to valid links.
Therefore, all links look valid.
If invalid links would be shown in red, it would allow for detection of invalid links.
So my suggestion is:
Beta Was this translation helpful? Give feedback.
All reactions