| Summary: | Open Links plugin should stop at closing parenthesis | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Grósz Dániel <groszdanielpub> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | wishlist | CC: | waqar.17a |
| Priority: | NOR | ||
| Version First Reported In: | 24.08.3 | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Grósz Dániel
2024-11-29 02:53:43 UTC
For markdown, the bracket should not be included. If you know of a case where bracket gets included please share.. (In reply to Waqar Ahmed from comment #1) > For markdown, the bracket should not be included. If you know of a case > where bracket gets included please share.. You're right, if the parenthesised are preceded by a closing square bracket, the parentheses don't get included, so Markdown links aren't broken. However, if it isn't preceded by a closing square bracket, the closing parenthesis does get included, even though it's more likely to be just a link, and perhaps some preceding text, in parentheses. Though some Wikipedia links contain parentheses; perhaps exclude a closing parenthesis only if the link doesn't contain a matching opening parenthesis? For a fully correct implementation we need to scan the whole doc for parenthesis. So its not very simple, e.g., think of a long comment ending with "link.com). (In reply to Waqar Ahmed from comment #3) > For a fully correct implementation we need to scan the whole doc for > parenthesis. So its not very simple, e.g., think of a long comment ending > with "link.com). It's always going to be a heuristic, I'm not even sure "fully correct" is meaningful, I'd just like a better heuristic like the current one. I think treating a ")" as ending a link unless the preceding part of the *link itself* contains more "("s than ")"s would almost always get it right. No need to check the preceding content: if the ")" isn't closing a parenthetical within the link itself, it's almost certainly closing a parenthetical surrounding the link, even if you don't check. |