[fix] use two tildes
This commit is contained in:
@@ -22,12 +22,22 @@ const mconverted = new Marked({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const safeConvertor = new showdown.Converter({
|
mconverted.use({
|
||||||
simpleLineBreaks: true,
|
tokenizer: {
|
||||||
strikethrough: true,
|
del(src) {
|
||||||
tables: true,
|
const cap = /^~~+(?=\S)([\s\S]*?\S)~~+/.exec(src);
|
||||||
backslashEscapesHTMLTags: true
|
if (cap) {
|
||||||
})
|
return {
|
||||||
|
type: 'del',
|
||||||
|
raw: cap[0],
|
||||||
|
text: cap[2],
|
||||||
|
tokens: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -176,7 +186,7 @@ export async function ParseMarkdown(data:string, charArg:(character|simpleCharac
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function parseMarkdownSafe(data:string) {
|
export function parseMarkdownSafe(data:string) {
|
||||||
return DOMPurify.sanitize(safeConvertor.makeHtml(data), {
|
return DOMPurify.sanitize(mconverted.parse(data), {
|
||||||
FORBID_TAGS: ["a", "style"],
|
FORBID_TAGS: ["a", "style"],
|
||||||
FORBID_ATTR: ["style", "href", "class"]
|
FORBID_ATTR: ["style", "href", "class"]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
|||||||
if(db.chainOfThought){
|
if(db.chainOfThought){
|
||||||
unformated.postEverything.push({
|
unformated.postEverything.push({
|
||||||
role: 'system',
|
role: 'system',
|
||||||
content: `<instruction>before respond everything, Think step by step as a ai assistant how would you respond inside <Thoughts> xml tag.</instruction>`
|
content: `<instruction> - before respond everything, Think step by step as a ai assistant how would you respond inside <Thoughts> xml tag. this must be less than 5 paragraphs.</instruction>`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user