Skip to content

Commit

Permalink
Format markdown in clarifications export correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
meisterT committed Mar 24, 2024
1 parent 1f4cc32 commit 2293b4e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
4 changes: 2 additions & 2 deletions webapp/templates/jury/export/clarifications.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<tr>
<td><b>Content</b></td>
<td colspan="5">
<pre>{{ clarification.body | wrapUnquoted(80) }}</pre>
<div class="card-text">{{ clarification.body | markdown_to_html | sanitize_html('app.clarification_sanitizer') }}</div>
</td>
</tr>
{% if clarification.replies is not empty %}
Expand All @@ -110,7 +110,7 @@
</b>
</td>
<td colspan="5">
<pre>{{ reply.body | wrapUnquoted(80) }}</pre>
<div class="card-text">{{ reply.body | markdown_to_html | sanitize_html('app.clarification_sanitizer') }}</div>
</td>
</tr>
{% endfor %}
Expand Down
23 changes: 22 additions & 1 deletion webapp/templates/jury/export/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,30 @@
padding-top: 2rem;
}
code {
font-size: .875em;
color: rgb(214, 51, 132);
word-wrap: break-word;
}
pre {
border-top: 1px dotted #C0C0C0;
border-bottom: 1px dotted #C0C0C0;
background-color: #FAFAFA;
margin: 0;
white-space: pre-wrap;
padding: 5px;
font-family: monospace;
white-space: pre;
}
pre > code {
color: inherit;
}
blockquote {
border-left: darkgrey solid .2em;
padding-left: .5em;
color: darkgrey;
}
</style>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ public function testClarificationsHtmlExport(): void
self::assertSelectorExists('h1:contains("Clarifications for Demo contest")');
self::assertSelectorExists('td:contains("Example teamname")');
self::assertSelectorExists('td:contains("A: Hello World")');
self::assertSelectorExists('pre:contains("Is it necessary to read the problem statement carefully?")');
self::assertSelectorExists('pre:contains("Lunch is served")');
self::assertSelectorExists('div:contains("Is it necessary to read the problem statement carefully?")');
self::assertSelectorExists('div:contains("Lunch is served")');
}

/**
Expand Down

0 comments on commit 2293b4e

Please sign in to comment.