Remove every H1 (^# and the setext H1 form) and demote every other
ATX heading by one level. Setext H2 (---- underline) stays as H2 because
converting it to H3 would require replacing the underline form.
Skips changes inside fenced code blocks.
Parameters
md: string
Raw Markdown source
Returns {md:string;h1Count:number}
{ md, h1Count } — transformed Markdown and number of H1s removed
Remove every H1 (
^#and the setext H1 form) and demote every other ATX heading by one level. Setext H2 (----underline) stays as H2 because converting it to H3 would require replacing the underline form.Skips changes inside fenced code blocks.