feature: first table implementation
This commit is contained in:
@@ -79,7 +79,7 @@ CQ CQ hier ist DL1PZ mit einem allgemeinen Anruf, hier ist DL1PZ und hört.
|
||||
</indepth>
|
||||
|
||||
<webmargin>
|
||||
| c | l | c | l | c | l |
|
||||
| c: | l: | c: | l: | c: | l: |
|
||||
| | | | | | |
|
||||
| A | [morse:a] | K | [morse:k] | U | [morse:u] |
|
||||
| B | [morse:b] | L | [morse:l] | V | [morse:v] |
|
||||
|
||||
@@ -7,7 +7,7 @@ from test.util import paragraph
|
||||
|
||||
|
||||
@pytest.mark.html
|
||||
def test_comment_html():
|
||||
def test_question_html():
|
||||
assertions = {
|
||||
"[question:123]": "123\n",
|
||||
"\n[question:123]\n": "123\n",
|
||||
@@ -24,7 +24,7 @@ def test_comment_html():
|
||||
|
||||
|
||||
@pytest.mark.latex
|
||||
def test_comment_latex():
|
||||
def test_question_latex():
|
||||
assertions = {
|
||||
"[question:123]": "123",
|
||||
"\n[question:123]\n": "123",
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import pytest
|
||||
from mistletoe import Document
|
||||
|
||||
from renderer.fifty_ohm_html_renderer import FiftyOhmHtmlRenderer
|
||||
|
||||
|
||||
@pytest.mark.html
|
||||
def test_question_html():
|
||||
assertions = {
|
||||
"| l: abc | r: abc | X: abc |\n| 123 | 456 | 789 | \n | 987 | 654 | 321 | ": "<table><tr><th style='text-align: left;'> abc</th><th style='text-align: right;'> abc</th><th> abc</th></tr><tr><td style='text-align: left;'>123</td><td style='text-align: right;'>456</td><td>789</td></tr><tr><td style='text-align: left;'>987</td><td style='text-align: right;'>654</td><td>321</td></tr></table>\n",
|
||||
"text\n| l: abc | r: abc | X: abc |\n| 123 | 456 | 789 | \n | 987 | 654 | 321 |\ntext": "text\n<table><tr><th style='text-align: left;'> abc</th><th style='text-align: right;'> abc</th><th> abc</th></tr><tr><td style='text-align: left;'>123</td><td style='text-align: right;'>456</td><td>789</td></tr><tr><td style='text-align: left;'>987</td><td style='text-align: right;'>654</td><td>321</td></tr></table>\ntext\n",
|
||||
}
|
||||
|
||||
def test_function(input):
|
||||
return f"{input}"
|
||||
|
||||
with FiftyOhmHtmlRenderer(test_function) as renderer:
|
||||
for assertion in assertions:
|
||||
assert renderer.render(Document(assertion)) == assertions[assertion]
|
||||
Reference in New Issue
Block a user