mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-11-21 19:12:23 +01:00
fix: erroneous unit test and missplaced whitespace
This commit is contained in:
parent
9fcc16f98b
commit
0e8c7d3175
@ -329,7 +329,7 @@ def translate_column(latex_column):
|
|||||||
"""
|
"""
|
||||||
Translate insides of a single latex tabular column to html
|
Translate insides of a single latex tabular column to html
|
||||||
"""
|
"""
|
||||||
hline_string_literal = "hline"
|
hline_string_literal = "\\hline"
|
||||||
replaced_hline = latex_column.replace(hline_string_literal, "<hr>")
|
replaced_hline = latex_column.replace(hline_string_literal, "<hr>")
|
||||||
replaced_newline = replaced_hline.replace("\newline", "<br>")
|
replaced_newline = replaced_hline.replace("\newline", "<br>")
|
||||||
return replaced_newline
|
return replaced_newline
|
||||||
|
|||||||
@ -6,7 +6,9 @@ def given_correct_then_correct():
|
|||||||
latex_string = "test & 2 & test \\ 4 & 5 & 6 \\"
|
latex_string = "test & 2 & test \\ 4 & 5 & 6 \\"
|
||||||
parameters_string = "{ l | c | r }"
|
parameters_string = "{ l | c | r }"
|
||||||
column_styles = tabular_required_parameters(parameters_string)
|
column_styles = tabular_required_parameters(parameters_string)
|
||||||
assert translate_inside_to_html(latex_string, column_styles) == "<table><tr><td align='left'>test </td><td style='border-left: 1px solid black'align='center'> 2 </td><td style='border-left: 1px solid black'align='right'> test </td></tr><tr><td align='left'> 4 </td><td style='border-left: 1px solid black'align='center'> 5 </td><td style='border-left: 1px solid black'align='right'> 6 </td></tr><tr><td align='left'></td></tr></table>"
|
assert translate_inside_to_html(latex_string, column_styles) == "<table><tr><td align='left'>test </td><td style='border-left: 1px solid black'> 2 </td><td style='border-left: 1px solid black'style='border-left: 1px solid black'> test </td></tr><tr><td align='left'> 4 </td><td style='border-left: 1px solid black'> 5 </td><td style='border-left: 1px solid black'style='border-left: 1px solid black'> 6 </td></tr><tr><td align='left'></td></tr></table>"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_translate_inside_to_html():
|
def test_translate_inside_to_html():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user