feature: ability to detect includes

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-06-24 22:04:14 +02:00
committed by Tim Grelka
parent 5d0084bac5
commit 2d0dc3e1fc
3 changed files with 44 additions and 1 deletions
+13
View File
@@ -0,0 +1,13 @@
import re
from mistletoe.span_token import SpanToken
class Include(SpanToken):
"""
Span token ("[include:ident]").
Includes raw html or javascript code from a file with the given identifier.
"""
parse_inner = False
pattern = re.compile(r'\[include:\s*([^\]]+)\]')