forked from Leaf/amber-ui
改进 如果不支持高亮,则默认纯文本
This commit is contained in:
parent
bd91bc5040
commit
7e915ff63f
@ -254,7 +254,7 @@ type Prompt = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
const userStore = useUserStore();
|
// const userStore = useUserStore();
|
||||||
const chatStore = useChatStore();
|
const chatStore = useChatStore();
|
||||||
const compositionStart = ref(false);
|
const compositionStart = ref(false);
|
||||||
const inputContainer: any = ref(null);
|
const inputContainer: any = ref(null);
|
||||||
|
@ -135,10 +135,11 @@ import config from "@/config/config";
|
|||||||
const mdIt = markdownIt();
|
const mdIt = markdownIt();
|
||||||
const mdInited = ref(true);
|
const mdInited = ref(true);
|
||||||
|
|
||||||
const unsupportedLanguages = ["assembly"];
|
const unsupportedLanguages = ["assembly", "blade"];
|
||||||
mdIt.options.highlight = function (str: string, lang: string) {
|
mdIt.options.highlight = function (str: string, lang: string) {
|
||||||
if (!lang || unsupportedLanguages.includes(lang)) {
|
if (!lang || unsupportedLanguages.includes(lang)) {
|
||||||
return str;
|
// return str;
|
||||||
|
lang = "text"
|
||||||
}
|
}
|
||||||
|
|
||||||
return hljs.highlight(str, { language: lang }).value;
|
return hljs.highlight(str, { language: lang }).value;
|
||||||
|
Loading…
Reference in New Issue
Block a user