Note use of $1 to keep the original text. Brackets seem to be needed for this to work.

Applied VS Code regex replace.

Add character

Add header symbol before a number.

  • Find: \d
  • Replace with: # $1

Add break tag

Insert br tag at the end of lines which are not headings or empty lines.

  • Find: (^[^#].+)
  • Replace with: $1<br>