Commit 5793ad5
committed
fix: Support URL extraction from markdown link syntax
Fixes #55849
Update URL_REGEX to match URLs embedded in markdown link syntax [label](url).
Previously, the regex required whitespace before/after URLs, which didn't
match markdown links where URLs are preceded by ]( and followed by ).
Also support square brackets in URL query parameters (e.g., ?foo[bar]=baz).
Changes:
- Add \]\( as valid URL prefix (markdown link start)
- Add \) as valid URL suffix (markdown link end)
- Add support for [ ] characters in URL paths
- Update both backend (IURLGenerator.php) and frontend (comments.js) regex
- Fix ReferenceManager to extract clean URLs using capture groups
- Maintain backward compatibility with plain URL extraction
Signed-off-by: Alexander Askin <[email protected]>1 parent 095e470 commit 5793ad5
3 files changed
Lines changed: 17 additions & 6 deletions
File tree
- core/src/OCP
- lib
- private/Collaboration/Reference
- public
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
58 | 68 | | |
59 | 69 | | |
60 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
0 commit comments