Commit 07eb033
[Repo Assist] fix: Markdown.ToMd preserves [body][key] form for unresolved indirect links (#1185)
* fix: Markdown.ToMd preserves [body][key] form for unresolved indirect links
Previously the unresolved-key fallback for IndirectLink used the second
field (original) as a direct-link URL, producing '[body](key)' which treats
the reference key as a URL. This was inconsistent with IndirectImage, which
preserves '![body][key]' when the key is unresolved.
Fix: split the two IndirectLink cases so the resolved path produces a direct
link '[body](url)' and the unresolved path preserves the indirect form
'[body][key]', matching IndirectImage behaviour.
Added test: 'ToMd preserves indirect link form when key is unresolved'
(347/347 Markdown tests pass).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: trigger checks
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>1 parent 0209e5b commit 07eb033
3 files changed
Lines changed: 12 additions & 2 deletions
File tree
- src/FSharp.Formatting.Markdown
- tests/FSharp.Markdown.Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1418 | 1418 | | |
1419 | 1419 | | |
1420 | 1420 | | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
1421 | 1430 | | |
1422 | 1431 | | |
1423 | 1432 | | |
| |||
0 commit comments