Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions readme_renderer/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
from cmarkgfm.cmark import Options as cmarkgfmOptions
variants: Dict[str, Callable[[str], str]] = {
"GFM": lambda raw: cast(str, cmarkgfm.github_flavored_markdown_to_html(
raw, options=cmarkgfmOptions.CMARK_OPT_UNSAFE
raw, options=(
cmarkgfmOptions.CMARK_OPT_UNSAFE | cmarkgfmOptions.CMARK_OPT_FOOTNOTES)
)),
"CommonMark": lambda raw: cast(str, cmarkgfm.markdown_to_html(
raw, options=cmarkgfmOptions.CMARK_OPT_UNSAFE
raw, options=(
cmarkgfmOptions.CMARK_OPT_UNSAFE | cmarkgfmOptions.CMARK_OPT_FOOTNOTES)
)),
}
except ImportError:
Expand Down
8 changes: 8 additions & 0 deletions tests/fixtures/test_GFM_footnotes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<p>a statement<sup><a href="#fn-1" id="fnref-1" rel="nofollow">1</a></sup></p>
<section>
<ol>
<li id="fn-1">
<p>this is true <a href="#fnref-1" rel="nofollow">↩</a></p>
</li>
</ol>
</section>
3 changes: 3 additions & 0 deletions tests/fixtures/test_GFM_footnotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a statement[^1]

[^1]: this is true
Loading