feat: 更新问题页面和提交页面,集成Vditor适配器,优化Markdown渲染

This commit is contained in:
2026-04-10 15:47:26 +08:00
parent 0c7297afd7
commit 40b77471b5
35 changed files with 1996 additions and 1004 deletions

View File

@@ -212,12 +212,19 @@
});
}
function renderProblemMarkdown() {
<?php if (isset($OJ_MARKDOWN) && $OJ_MARKDOWN) { ?>
return HustOJVditor.renderMarkdownBlocks('div.md');
<?php } ?>
return Promise.resolve([]);
}
window.renderProblemMarkdown = renderProblemMarkdown;
$(document).ready(function () {
<?php if (isset($OJ_MARKDOWN) && $OJ_MARKDOWN) { ?>
$("div.md").each(function () {
$(this).html(marked.parse($(this).html()));
});
<?php } ?>
renderProblemMarkdown().catch(function (error) {
console.error('Failed to render problem markdown.', error);
});
});