Pull request #3: refactor: move comment tokenizer to separate file

Merge in FRAG/50ohm.de from refactor-token to main

* commit '2ea0599b1ba780fe2627430a03730af4399d86b8':
  refactor: move comment tokenizer to separate file
This commit is contained in:
Prof.Dr. Matthias Jung DL9MJ
2024-12-07 13:02:26 +00:00
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