-
-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Users posting links with destination "URL" instead of intended one #809
Comments
I can confirm - this is not an imaginary issue but the real one. I have seen it a few times on the demo site, but can't reproduce it. this is what I have tried
All the above make the expected URL. The only thing remotely similar to the reported issue is an attempt to publish a relative link, for example:
None of those really surprising, and such links make no sense in general. |
ok, from what I see the incorrect one was submitted as this I think this is the user's error. Highly unlikely something like this may happen if the user typing URL in MD manually, so I guess the user clicked on the button (toolbar), which populates cc @akellbl4 note: just in case if a reader wonders how I got access to the log - this is not because remark42 reports to the mothership, but because I'm the admin for that particular site (radio-t.com) |
Maybe a linter-like functionality for markdown renderer can be a good idea. It can detect suspicious link usage, such as:
|
@umputun I've checked if we can put the cursor to another place. It could be done only if we fork lib that we use for MD buttons. Because they don't want to expose base class for these buttons which implement snippet inserting and put caret position. P.S. We use the same buttons as GitHub has in the comments and they have the same behavior. |
I think matching |
@paskal we don't do any parsing for markdown on frontend, so it could involve adding those packages and I don't think it a good way to check links. The ideal situation when user is trying to post comment it's validated on BE and if error is there it returns the error as we do with all of the possible problems in comment text. |
Do we really need a parser for this? The particular case is about a substring match, i.e., if the text area has |
I mean we do validate comment text on server so I wouldn't spread those validations between FE and BE. Especially in order to keep FE simple BE is always the better place to do those things. Maybe we even should add http/https automatically. |
Btw this is how it's handled here |
Well, we can validate on the server side for sure; this is easy to do. However, it may return you a very basic "rejection", like a bad request or expectation failed status. In the json body, we can add extra things like "invalid URL" or something like this; however, I don't think this will help you highlight the text's troublesome part. If you do it on your side, I guess it is much easier to indicate what part of the text is invalid. Generally, I have nothing against server-side verification here; the only issue I'm trying to address here is the better user experience. |
Hm, I didn't plan to highlight specific text in the text area. To be honest I don't know any way of doing that. I can imagine how we can do that but adding such highlighting will be way over engineered for such problem. |
@akellbl4 I've prepared the backend part of the validation. Could you please alter the frontend will work properly with it? |
I've created the issue #1673 about what is left to be done about this issue. I am resolving this one in favour of 1673. |
Not sure if bug or UI misuse, but sometimes links are replaced with
$REMARK_DOMAIN/web/url
URL.For example checkout this page: https://radio-t.com/p/2020/11/03/prep-727/#comments
Examples of generated HTML:
<a href="url" rel="nofollow">https://winxp.now.sh/</a>
<a href="url" rel="nofollow">https://samy.pl/slipstream/</a>
If somebody can reproduce, please answer - I can spent some time to fix this bug (if presented).
The text was updated successfully, but these errors were encountered: