✨ feat: 更新问题页面和提交页面,集成Vditor适配器,优化Markdown渲染
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user