This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
🐛 Unexpected behavior for outgoing links on markdown pages #1086
Labels
type: bug
Something isn't working
Short description of the bug
When linking to website outside of dsek.se with markdown, it has to be properly written. Otherwise, it will not work.
This is because when writing outgoing links in markdown, you need to include
https://
for it to register as an outgoing link. Ifhttps://
is not included, markdown thinks it's an internal link.The most simple solution would be to inform people the correct way to write markdown links. But I think this can be solved programmatically. When the editor tries to save, scan the text for links and either try get a web-request for the link, or match it to some pattern (contains
https://
or something). If any fails, disallow the change and inform the one trying to edit the page that they need the correct link format.To Reproduce
Create an outgoing link without
https://
, i.e.[click here to visit another website](example.com)
.Expected behavior
The markdown rendered text should take you to the outgoing page, i.e.
https://example.com
Actual behavior
Tries to find the page internally, i.e. on dsek.se, so the user gets taken to
dsek.se/example.com
Context
Currently, on https://www.dsek.se/contact-us, The Student Well-being Committee has such a link that doesn't work. It is written as
[bit.ly/kontaktatrivsel](bit.ly/kontaktatrivsel)
, but markdown will direct you to https://www.dsek.se/bit.ly/kontaktatrivsel which doesn't exists.Environment (If applicable)
Everywhere
The text was updated successfully, but these errors were encountered: