mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Formatting: Ignore chat separators with markdown
Some chat separators (or dinkuses) cause markdown to be rendered on the chat window. Examples include "###" -> h3 and "---" -> metadata. This can look jarring to the end user as it can interrupt a pleasant chat experience. Therefore, it makes sense to ignore these lines with div tags that indicate to Showdown that this string doesn't need markdown. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@ -148,6 +148,7 @@ import {
|
||||
} from "./scripts/secrets.js";
|
||||
import { EventEmitter } from './scripts/eventemitter.js';
|
||||
import { context_settings, loadContextTemplatesFromSettings } from "./scripts/context-template.js";
|
||||
import { dinkusExtension } from "./scripts/showdown-dinkus.js";
|
||||
|
||||
//exporting functions and vars for mods
|
||||
export {
|
||||
@ -533,6 +534,14 @@ function reloadMarkdownProcessor(render_formulas = false) {
|
||||
});
|
||||
}
|
||||
|
||||
// Inject the dinkus extension after creating the converter
|
||||
// Maybe move this into power_user init?
|
||||
setTimeout(() => {
|
||||
if (power_user) {
|
||||
converter.addExtension(dinkusExtension(), 'dinkus');
|
||||
}
|
||||
}, 1)
|
||||
|
||||
return converter;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user