Skip to content

Commit 10108a9

Browse files
committed
Also render new elements for the preview
This should only run the script for the modal element to make it fast enough to not use the Promise.
1 parent eb53653 commit 10108a9

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

webapp/public/js/domjudge.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@ function previewClarification($input, $previewDiv) {
939939
}
940940
}).done(function (data) {
941941
$previewDiv.html(data.html);
942+
MathJax.typesetPromise([document.getElementById($previewDiv[0].id)]);
942943
});
943944
}
944945
}

webapp/templates/team/clarification_modal.html.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ View clarification
1010

1111
{% block content %}
1212
{% include 'team/partials/clarification_content.html.twig' %}
13+
<script>
14+
MathJax.typeset([document.getElementsByClassName('card-body')]);
15+
</script>
1316
{% endblock %}
1417
{% block extraButton %}
1518
<button class="btn btn-secondary" data-bs-toggle="collapse" data-bs-target="#collapsereplyform"

webapp/templates/team/partials/clarification_list.html.twig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</td>
6363
{% endif %}
6464

65-
<td>
65+
<td class="clarification-text">
6666
<a data-ajax-modal data-ajax-modal-after="markSeen" href="{{ link }}">
6767
{{ clarification.summary | markdown_to_html | sanitize_html('app.clarification_sanitizer') }}
6868
</a>
@@ -72,4 +72,7 @@
7272

7373
</tbody>
7474
</table>
75+
<script>
76+
MathJax.typeset([document.getElementsByClassName('clarification-text')]);
77+
</script>
7578
</div>

0 commit comments

Comments
 (0)