(content, language = "")
| 1612 | } |
| 1613 | |
| 1614 | function fencedBlock(content, language = "") { |
| 1615 | const text = String(content || ""); |
| 1616 | const fence = safeFence(text); |
| 1617 | let block = fence + language + "\n" + text; |
| 1618 | if (!text.endsWith("\n")) block += "\n"; |
| 1619 | return block + fence; |
| 1620 | } |
| 1621 | |
| 1622 | function safeFence(content) { |
| 1623 | const matches = String(content || "").match(/`+/g) || []; |