改进 主机以及保存的内容

This commit is contained in:
iVampireSP.com 2023-02-22 22:18:35 +08:00
parent 4a6ae20319
commit 4c77447fd7
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -151,18 +151,24 @@
<script> <script>
let editor; let editor;
let darkTheme = false;
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
darkTheme = true;
}
editor = editormd("content", { editor = editormd("content", {
width: "100%", width: "100%",
height: 740, height: 740,
path: '{{ asset('vendor/editor.md/lib') }}/', path: '{{ asset('vendor/editor.md/lib') }}/',
theme: "dark", theme: darkTheme ? 'dark' : 'default',
previewTheme: "dark", previewTheme: darkTheme ? 'dark' : 'default',
editorTheme: "pastel-on-dark", editorTheme: darkTheme ? 'pastel-on-dark' : 'default',
markdown: "{{ old('content') }}", markdown: "{{ old('content') }}",
codeFold: true, codeFold: true,
saveHTMLToTextarea: true, // 保存 HTML 到 Textarea saveHTMLToTextarea: false,
searchReplace: true, searchReplace: true,
htmlDecode: "style,script,iframe|on*", // 开启 HTML 标签解析,为了安全性,默认不开启 htmlDecode: "style,script,iframe|on*",
imageUpload: false, imageUpload: false,
imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp"], imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL: "./php/upload.php", imageUploadURL: "./php/upload.php",