Commit 641baa2
[Repo Assist] fix: Markdown.ToMd preserves indented code blocks as fenced code blocks (#1134)
* fix: Markdown.ToMd preserves indented code blocks as fenced code blocks
Indented code blocks (parsed with fence = None) were serialised by
Markdown.ToMd as bare text without any code block markers. When the
output was re-parsed, the content was interpreted as a Paragraph, not
a CodeBlock — breaking the round-trip.
Fix: use triple-backtick fences for code blocks that originally had no
fence, ensuring the serialised form is always a valid fenced code block.
Fenced code blocks round-trip correctly and render identically to
indented code blocks in all Markdown renderers.
Added a round-trip test to cover the case.
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>
Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>1 parent d98e7e6 commit 641baa2
File tree
3 files changed
+41
-6
lines changed- src/FSharp.Formatting.Markdown
- tests/FSharp.Markdown.Tests
3 files changed
+41
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
196 | | - | |
197 | | - | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1444 | 1444 | | |
1445 | 1445 | | |
1446 | 1446 | | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1447 | 1479 | | |
1448 | 1480 | | |
1449 | 1481 | | |
| |||
0 commit comments