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

@@ -1,30 +1,26 @@
<meta charset="utf-8" />
<link rel="stylesheet" href="../kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="../kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="../kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="../kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="../kindeditor/plugins/code/prettify.js"></script>
<script src="../include/vditor-adapter.js"></script>
<script>
KindEditor.ready(function(K) {
var editor1 = K.create('textarea[class="kindeditor"]', {
width : '100%',
cssPath : '../kindeditor/plugins/code/prettify.css',
uploadJson : '../kindeditor/php/upload_json.php',
fileManagerJson : '../kindeditor/php/file_manager_json.php',
allowFileManager : false,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
$(document).ready(function () {
HustOJVditor.initTextareaVditors({
selector: 'textarea.kindeditor',
uploadUrl: '../kindeditor/php/upload_json.php',
accept: '*/*',
mode: 'sv',
ctrlEnterFormName: 'example',
preview: {
mode: 'both',
delay: 0,
actions: [],
markdown: {
sanitize: false,
autoSpace: false,
fixTermTypo: false
}
}
}).catch(function (error) {
console.error('Failed to initialize Vditor.', error);
});
// prettyPrint();
});
</script>