mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-26 06:11:15 +00:00
Allow limited set of markdown in title rendering (#1977)
This commit is contained in:
parent
a67c70a449
commit
925d9624d5
1 changed files with 9 additions and 1 deletions
|
@ -23,6 +23,14 @@ export let md: MarkdownIt = new MarkdownIt();
|
||||||
|
|
||||||
export let mdNoImages: MarkdownIt = new MarkdownIt();
|
export let mdNoImages: MarkdownIt = new MarkdownIt();
|
||||||
|
|
||||||
|
// Zero disables all rules.
|
||||||
|
// Only explicitly allow a limited set of rules safe for use in post titles.
|
||||||
|
export const mdLimited: MarkdownIt = new MarkdownIt("zero").enable([
|
||||||
|
"emphasis",
|
||||||
|
"backticks",
|
||||||
|
"strikethrough",
|
||||||
|
]);
|
||||||
|
|
||||||
export const customEmojis: EmojiMartCategory[] = [];
|
export const customEmojis: EmojiMartCategory[] = [];
|
||||||
|
|
||||||
export let customEmojisLookup: Map<string, CustomEmojiView> = new Map<
|
export let customEmojisLookup: Map<string, CustomEmojiView> = new Map<
|
||||||
|
@ -43,7 +51,7 @@ export function mdToHtmlNoImages(text: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mdToHtmlInline(text: string) {
|
export function mdToHtmlInline(text: string) {
|
||||||
return { __html: md.renderInline(text) };
|
return { __html: mdLimited.renderInline(text) };
|
||||||
}
|
}
|
||||||
|
|
||||||
const spoilerConfig = {
|
const spoilerConfig = {
|
||||||
|
|
Loading…
Reference in a new issue