mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-03 12:47:35 +01:00
Don't convert markdown to plaintext
This commit is contained in:
parent
8c11d7e8e8
commit
edf981a5a1
@ -1341,11 +1341,7 @@ export async function extractTextFromHTML(blob, textSelector = 'body') {
|
||||
*/
|
||||
export async function extractTextFromMarkdown(blob) {
|
||||
const markdown = await blob.text();
|
||||
const converter = new showdown.Converter();
|
||||
const html = converter.makeHtml(markdown);
|
||||
const domParser = new DOMParser();
|
||||
const document = domParser.parseFromString(DOMPurify.sanitize(html), 'text/html');
|
||||
const text = postProcessText(document.body.textContent, false);
|
||||
const text = postProcessText(markdown, false);
|
||||
return text;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user