diff --git a/webapp/templates/partials/mathjaxhead.html.twig b/webapp/templates/partials/mathjaxhead.html.twig new file mode 100644 index 0000000000..128a3fbec0 --- /dev/null +++ b/webapp/templates/partials/mathjaxhead.html.twig @@ -0,0 +1,23 @@ + + diff --git a/webapp/templates/team/index.html.twig b/webapp/templates/team/index.html.twig index ae6244810d..cc5e8d3a66 100644 --- a/webapp/templates/team/index.html.twig +++ b/webapp/templates/team/index.html.twig @@ -46,6 +46,8 @@ } $('[data-flash-messages]').html($flash); + + MathJax.typeset([document.getElementsByClassName('clarification-text')]); } window.initModalClarificationPreviewAdd = function() { diff --git a/webapp/templates/team/partials/clarification.html.twig b/webapp/templates/team/partials/clarification.html.twig index 5004e4c0d4..9045ceadde 100644 --- a/webapp/templates/team/partials/clarification.html.twig +++ b/webapp/templates/team/partials/clarification.html.twig @@ -40,7 +40,7 @@
- {{ clarification.body | markdown_to_html | sanitize_html('app.clarification_sanitizer') }} + {{ clarification.body | domjudgeMarkdownToHtml | sanitize_html('app.clarification_sanitizer') }}
diff --git a/webapp/templates/team/partials/clarification_content.html.twig b/webapp/templates/team/partials/clarification_content.html.twig index 7e38c1e53c..a3d2e03e52 100644 --- a/webapp/templates/team/partials/clarification_content.html.twig +++ b/webapp/templates/team/partials/clarification_content.html.twig @@ -24,3 +24,7 @@ {{ form_end(form) }} + + diff --git a/webapp/templates/team/partials/clarification_list.html.twig b/webapp/templates/team/partials/clarification_list.html.twig index a8afe67896..93de2996c2 100644 --- a/webapp/templates/team/partials/clarification_list.html.twig +++ b/webapp/templates/team/partials/clarification_list.html.twig @@ -48,15 +48,18 @@ {%- endif -%} - + {{ clarification.summary - | markdown_to_html + | domjudgeMarkdownToHtml | replace({'

': '', '

': ''}) | sanitize_html('app.clarification_sanitizer') | raw }}
+ {%- endfor %} diff --git a/webapp/yarn.lock b/webapp/yarn.lock index e2e9f4c3c0..0c7d920b65 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -7,6 +7,11 @@ resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-7.1.0.tgz#8eb76278515341720aa74485266f8be121089529" integrity sha512-+WxNld5ZCJHvPQCr/GnzCTVREyStrAJjisUPtUxG5ngDA8TMlPnKp6dddlTpai4+1GNmltAeuk1hJEkBohwZYA== +"@mathjax/mathjax-newcm-font@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@mathjax/mathjax-newcm-font/-/mathjax-newcm-font-4.0.0.tgz#01afa8b20f2114665dc1d9a7fbc623a23ddb54e4" + integrity sha512-kpsJgIF4FpWiwIkFgOPmWwy5GXfL25spmJJNg27HQxPddmEL8Blx0jn2BuU/nlwjM/9SnYpEfDrWiAMgLPlB8Q== + "@melloware/coloris@^0.25.0": version "0.25.0" resolved "https://registry.yarnpkg.com/@melloware/coloris/-/coloris-0.25.0.tgz#7012c10dc510dca1660b3692ed3c812344aec6ca" @@ -79,6 +84,13 @@ marked@14.0.0: resolved "https://registry.yarnpkg.com/marked/-/marked-14.0.0.tgz#79a1477358a59e0660276f8fec76de2c33f35d83" integrity sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ== +mathjax@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mathjax/-/mathjax-4.0.0.tgz#ff7aa8b6bfdc7e97e41091a9ed6d8c8f8eefd2a0" + integrity sha512-ThMPHiPl9ibZBInAmfoTCNq9MgCdH7ChIQ9YhKFc325noJ4DMzy9/Q14qdcuPzVJjEmC3kyXhwnERZWX3hbWzQ== + dependencies: + "@mathjax/mathjax-newcm-font" "^4.0.0" + monaco-editor@^0.54.0: version "0.54.0" resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.54.0.tgz#c0d6ebb46b83f1bef6f67f6aa471e38ba7ef8231"