Commit ee19a02
Don't autolink URLs used as markdown link text (#3319)
* stop autolinking links that are markdown link titles
* move nested-link guard to the renderer
The parser-level check only caught the case where the autolink URL
appeared immediately after `[`. Once any literal text intervened, the
LinkDelimiterInline walk-back missed it. Detecting nested links in the
renderer instead works for every parse shape.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Strengthen nested-anchor regression tests for #3317
Replace fragile exact-string NotContain with NotMatchRegex to catch
nested <a> regardless of attribute ordering. Add ImageInsideLinkTests
to confirm the IsImage branch is unaffected by the IsNestedInsideLink
guard.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Fabrizio Ferri Benedetti <fabri.ferribenedetti@elastic.co>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent e614b91 commit ee19a02
2 files changed
Lines changed: 71 additions & 0 deletions
File tree
- src/Elastic.Markdown/Myst/Renderers
- tests/Elastic.Markdown.Tests/Inline
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
110 | 129 | | |
111 | 130 | | |
112 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
248 | 300 | | |
249 | 301 | | |
250 | 302 | | |
| |||
0 commit comments