You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code exists to avoid that one can write stacker.news which looks like it's a link to stacker.news but it's actually not (this works on Github too though).
// If [text](url) was parsed as <a> and text is not empty and not a link itself,
// we don't render it as an image since it was probably a conscious choice to include text.
consttext=children[0]
leturl
try{
url=!href.startsWith('/')&&newURL(href)
}catch{
// ignore invalid URLs
}
The above was wrong, it's actually the isRawURL check in this code that was written to avoid disguised links.
However, it only works for [https://stacker.news](https://www.youtube.com/watch?v=dQw4w9WgXcQ)]
and not [stacker.news](https://www.youtube.com/watch?v=dQw4w9WgXcQ).
Description
This code exists to avoid that one can write stacker.news which looks like it's a link to stacker.news but it's actually not (this works on Github too though).stacker.news/components/text.js
Lines 181 to 189 in 36e9f3f
The above was wrong, it's actually the
isRawURL
check in this code that was written to avoid disguised links.However, it only works for
[https://stacker.news](https://www.youtube.com/watch?v=dQw4w9WgXcQ)]
and not
[stacker.news](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
.stacker.news/components/media-or-link.js
Lines 13 to 24 in 450c969
It doesn't even get hit for
stacker.news
as text.Steps to Reproduce
[stacker.news](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
Expected behavior
It should refuse to use the text chosen by the user if it looks like it's pretending to be another link
Logs
If applicable, add your browsers console logs.
Environment:
If you only experience the issue on certain devices or browsers, provide that info.
Additional context
https://stacker.news/items/682259
Maybe we shouldn't attempt to stop this since Github also doesn't? So mark as
wontfix
?The text was updated successfully, but these errors were encountered: