Skip to content

Commit

Permalink
fix: Lists may not be sane
Browse files Browse the repository at this point in the history
  • Loading branch information
YDX-2147483647 committed Mar 30, 2024
1 parent 217c9ec commit 0229dea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 9 additions & 0 deletions hooks/patch_mdx_truly_sane_lists.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Patch mdx_truly_sane_lists to recognize the number used in ordered lists
Usage: [Sane Lists — Python-Markdown documentation](https://python-markdown.github.io/extensions/sane_lists/)
"""

# https://github.com/radude/mdx_truly_sane_lists/issues/21#issuecomment-2028015918
from mdx_truly_sane_lists.mdx_truly_sane_lists import TrulySaneOListProcessor

TrulySaneOListProcessor.LAZY_OL = False
5 changes: 1 addition & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ markdown_extensions:
- admonition
- pymdownx.details
- md_in_html
# sane_lists should be put after mdx_truly_sane_lists.
# Reason: sane_lists respects numbers in `<ol>` (ordered lists), which are ignored by default.
# However mdx_truly_sane_lists also touches `<ol>`, and we should let sane_lists make the final decision.
- mdx_truly_sane_lists
- sane_lists
- toc:
permalink: true
slugify: !!python/object/apply:pymdownx.slugs.slugify
Expand Down Expand Up @@ -89,6 +85,7 @@ plugins:
hooks:
- hooks/add_authors.py
- hooks/external_link_in_new_tab.py
- hooks/patch_mdx_truly_sane_lists.py

watch:
- hooks
Expand Down

0 comments on commit 0229dea

Please sign in to comment.