duo-labs / duo-labs/markflow

Code block start and end tags used in footnotes are de-indented

Open
#68 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
21
Forks
4
PR merge metrics
No merged PRs in 30d

Description

I have a document with something similar to the following:

Some text with a footnote[^0].

[^0]: Here is some code:
```bash
git log --since 2022-01-01 --pretty=format:%cs directory/ \
| awk -F- '{print $1,$2}' \
| sort -n \
| uniq -c \
| awk '{print $1}' \
| awk '{s+=$1}END{print s/NR}'
```
Some further exposition.

Running the above through pandoc, e.g. `pandoc -s --from=gfm --to=html5 doc.md > doc.html` does what I expect, e.g.:

Some text with a footnote^1:

----------------------------
1. Here is some code:

git log --since 2022-01-01 --pretty=format:%cs directory/ \
| awk -F- '{print $1,$2}' \
| sort -n \
| uniq -c \
| awk '{print $1}' \
| awk '{s+=$1}END{print s/NR}'

Some further exposition.

But if I use markflow first, the above is reformatted:

Some text with a footnote[^0].

[^0]: Here is some code:
```bash
git log --since 2022-01-01 --pretty=format:%cs directory/ \
| awk -F- '{print $1,$2}' \
| sort -n \
| uniq -c \
| awk '{print $1}' \
| awk '{s+=$1}END{print s/NR}'
```
Some further exposition.

With the result being that pandoc makes the footnote `Here is some code:`, and drops the rest of the footnote content directly under the block of text with the footnote:

Some text with a footnote^1:

git log --since 2022-01-01 --pretty=format:%cs directory/ \
| awk -F- '{print $1,$2}' \
| sort -n \
| uniq -c \
| awk '{print $1}' \
| awk '{s+=$1}END{print s/NR}'

Some further exposition.
----------------------------
1. Here is some code:

Additionally, in the latter example, `Some further exposition.` is in 'code' font vs. the default font.

I don't think this a pandoc issue, as GitHub will do something similar when pasting in the seemingly-misflowed markdown.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.