opt: optimize markdown image parser, identify image and blockquote tags

This commit is contained in:
RockYang
2024-01-16 10:13:00 +08:00
parent bd057a4cc9
commit 36a2626ccc
4 changed files with 33 additions and 10 deletions

View File

@@ -102,6 +102,13 @@ export default defineComponent({
border-radius: 5px;
overflow: auto;
img {
max-width: 600px;
border-radius: 10px;
margin 10px 0
}
a {
color #20a0ff
}

View File

@@ -53,6 +53,7 @@ import {ref} from "vue";
import {ElMessage} from "element-plus";
import {httpGet, httpPost} from "@/utils/http";
import {PictureFilled, Plus} from "@element-plus/icons-vue";
import {isImage} from "@/utils/libs";
const props = defineProps({
userId: String,
@@ -69,11 +70,6 @@ const fetchFiles = () => {
})
}
const isImage = (ext) => {
const expr = /\.(jpg|jpeg|png|gif|bmp|svg)$/i;
return expr.test(ext);
}
const getFileIcon = (ext) => {
const files = {
".docx": "doc.png",