feature: add comment test

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2024-12-08 10:14:35 +01:00
parent bedab8faa8
commit bc53eb0f9e
3 changed files with 46 additions and 8 deletions
+11 -1
View File
@@ -1,7 +1,17 @@
import re
from mistletoe.block_token import BlockToken
from mistletoe.span_token import SpanToken
class Comment(BlockToken):
class SpanComment(SpanToken):
"""
Coment span token (% Eiersalat).
Identifies a comment in text.
"""
pattern = re.compile(r'(%.*\n?)')
class BlockComment(BlockToken):
@staticmethod
def start(line):
return line.startswith("%")