Wrap type answer output in code tag; remove extra div

This would make more sense as a class on the outer div, but existing
templates reference code#typeans, so avoid breaking things for now.
This commit is contained in:
Damien Elmes 2022-07-22 20:29:39 +10:00
parent eceacb643b
commit 340da23104
3 changed files with 6 additions and 2 deletions

View file

@ -602,7 +602,7 @@ class Reviewer:
# can't pass a string in directly, and can't use re.escape as it
# escapes too much
s = """
<span style="font-family: '{}'; font-size: {}px">{}</span>""".format(
<div style="font-family: '{}'; font-size: {}px">{}</div>""".format(
self.typeFont,
self.typeSize,
output,

View file

@ -90,7 +90,7 @@ impl DiffContext {
let provided = render_tokens(&output.provided);
let expected = render_tokens(&output.expected);
format!(
"<div style='white-space: pre-wrap;'>{}</div>",
"<code id=typeans>{}</code>",
if no_mistakes(&output.expected) {
provided
} else {

View file

@ -52,6 +52,10 @@ li {
box-sizing: border-box;
}
code#typeans {
white-space: pre-wrap;
}
.typeGood {
background: #afa;
color: black;