Commit d98e7e6
[Repo Assist] fix: Markdown.ToMd preserves YAML frontmatter (#1165)
* fix: Markdown.ToMd preserves YAML frontmatter
When Markdown.ToMd serialises a parsed MarkdownDocument back to Markdown
text, YamlFrontmatter paragraphs were silently dropped. Documents
containing a YAML front-matter block (--- ... ---) would lose that block
on round-trip.
Fix: emit the --- delimiters and frontmatter lines in formatParagraph so
round-trips are lossless.
Add two new tests: one with populated frontmatter and one with an empty
block.
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: Don Syme <dsyme@users.noreply.github.com>1 parent b013f37 commit d98e7e6
File tree
3 files changed
+25
-1
lines changed- src/FSharp.Formatting.Markdown
- tests/FSharp.Markdown.Tests
3 files changed
+25
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
302 | 309 | | |
303 | 310 | | |
304 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1632 | 1632 | | |
1633 | 1633 | | |
1634 | 1634 | | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
1635 | 1651 | | |
1636 | 1652 | | |
1637 | 1653 | | |
| |||
0 commit comments