refactor: move comment tokenizer to separate file

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2024-12-07 14:00:07 +01:00
parent 40a88ba899
commit 2ea0599b1b
2 changed files with 14 additions and 11 deletions
+12
View File
@@ -0,0 +1,12 @@
from mistletoe.block_token import BlockToken
class Comment(BlockToken):
@staticmethod
def start(line):
return line.startswith("%")
@classmethod
def read(cls, lines):
next(lines)
return None
+2 -11
View File
@@ -1,5 +1,6 @@
from mistletoe import HtmlRenderer from mistletoe import HtmlRenderer
from mistletoe.block_token import BlockToken
from renderer.comment import Comment
class FiftyOhmHtmlRenderer(HtmlRenderer): class FiftyOhmHtmlRenderer(HtmlRenderer):
@@ -9,13 +10,3 @@ class FiftyOhmHtmlRenderer(HtmlRenderer):
def render_comment(): def render_comment():
return None return None
class Comment(BlockToken):
@staticmethod
def start(line):
return line.startswith("%")
@classmethod
def read(cls, lines):
next(lines)
return None