feat: implement custom comment syntax
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from mistletoe import HtmlRenderer
|
||||
from mistletoe.block_token import BlockToken
|
||||
|
||||
|
||||
class FiftyOhmHtmlRenderer(HtmlRenderer):
|
||||
def __init__(self):
|
||||
super().__init__(Comment)
|
||||
|
||||
def render_comment():
|
||||
return None
|
||||
|
||||
|
||||
class Comment(BlockToken):
|
||||
@staticmethod
|
||||
def start(line):
|
||||
return line.startswith("%")
|
||||
|
||||
@classmethod
|
||||
def read(cls, lines):
|
||||
next(lines)
|
||||
return None
|
||||
Reference in New Issue
Block a user