1
0
mirror of https://github.com/venthur/blag.git synced 2025-11-25 12:42:41 +00:00

Merge pull request #303 from venthur/footnotes

Added footnotes
This commit is contained in:
Bastian Venthur
2025-11-04 09:09:39 +01:00
committed by GitHub
5 changed files with 24 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
* Added Python 3.14 compatibility
* Removed requirements.txt and requirements-dev.txt
* Added footnotes extension for markdown
## [2.3.3] -- 2025-04-27

View File

@@ -21,6 +21,7 @@ blag is named after [the blag of the webcomic xkcd][blagxkcd].
* Theming support using [Jinja2][] templates
* Generation of Atom feeds for blog content
* Fenced code blocks and syntax highlighting using [Pygments][]
* Markdown footnotes
* Integrated devserver
* Available on [PyPI][]

View File

@@ -34,6 +34,7 @@ def markdown_factory() -> Markdown:
"fenced_code",
"codehilite",
"smarty",
"footnotes",
MarkdownLinkExtension(),
],
output_format="html",

View File

@@ -151,3 +151,10 @@ header h2 {
display: inline;
font-size: 1.2rem;
}
hr {
border: none;
border-top: 1px solid var(--foreground-dim);
opacity: 0.3;
margin: 2rem 0;
}

View File

@@ -111,3 +111,17 @@ this --- is -- a test ...
assert "mdash" not in html
assert "ndash" not in html
assert "hellip" not in html
def test_footnotes() -> None:
"""Test footnote extension."""
md = markdown_factory()
md1 = """
this is a footnote[^1]
[^1]: this is the footnotetext
"""
html, meta = convert_markdown(md, md1)
assert "<hr>" in html
assert "<ol>" in html
assert "footnotetext" in html