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

@@ -423,19 +423,19 @@ function loadFromBlockly(){
}
?>
<?php if($OJ_ACE_EDITOR){ ?>
<script src="<?php echo $OJ_CDN_URL?>ace/ace.js"></script>
<script src="<?php echo $OJ_CDN_URL?>ace/ext-language_tools.js"></script>
<script src="include/vditor-adapter.js"></script>
<script>
ace.require("ace/ext/language_tools");
var editor = ace.edit("source");
editor.setTheme("ace/theme/xcode");
var editor = HustOJVditor.createDeferredCodeEditor({
container: "source",
hiddenField: "hide_source",
theme: "ace/theme/xcode",
fontSize: 18
});
switchLang(<?php echo $lastlang ?>);
editor.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true, //改为true,打开自动补齐功能改为false关闭
// fontFamily: "Consolas", // MacOS missing align
// theme: "ace/theme/ambiance", // Black theme
enableLiveAutocompletion: true,
fontSize: "18px"
});
reloadtemplate($("#language").val());