GESIS-Methods-Hub / andrew

Content Aggregation System for tutorials and vignette of reproducible computational methods.
https://gesis-methods-hub.github.io/andrew/
MIT License
2 stars 0 forks source link

Pandoc requires no text before H1 #209

Closed rgaiacs closed 11 months ago

rgaiacs commented 11 months ago
$ pandoc --from markdown --to markdown -s --shift-heading-level-by -1 <<EOF
# Title
EOF

produces

---
title: Title
---

This is the behaviour that we are looking. Unfortunatelly,

$ pandoc --from markdown --to markdown -s --shift-heading-level-by -1 <<EOF
foo

# Title
EOF

produces

foo

Title

where the title was transformed into a paragraph. The same happens when we have a comment:

$ pandoc --from markdown --to markdown -s --shift-heading-level-by -1 <<EOF
<!-- foo -->

# Title
EOF

produces

```{=html}
<!-- foo -->

Title