feature: add latex comment

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2024-12-08 16:57:01 +01:00
parent 8f4778b8b4
commit 4a320cfaeb
+14 -5
View File
@@ -1,13 +1,10 @@
import mistletoe
import pytest
from mistletoe.ast_renderer import AstRenderer
from renderer.comment import BlockComment, SpanComment
from renderer.fifty_ohm_html_renderer import FiftyOhmHtmlRenderer
from test.util import paragraph
from renderer.fifty_ohm_latex_renderer import FiftyOhmLaTeXRenderer
def test_comment_html(capsys) :
def test_comment_html() :
assertions = {
"%Comment\nBar" : "<p>Bar</p>\n",
@@ -18,3 +15,15 @@ def test_comment_html(capsys) :
for assertion in assertions:
assert mistletoe.markdown(assertion, FiftyOhmHtmlRenderer) == assertions[assertion]
def test_comment_latex() :
assertions = {
"%Comment\nBar" : "\nBar\n",
# TODO: This test is not working as expected. The comment should be removed
#"%Comment\n" : "a",
"Foo\n%Comment\nBar" : "\nFoo\nBar\n",
}
for assertion in assertions:
assert mistletoe.markdown(assertion, FiftyOhmLaTeXRenderer) == assertions[assertion]