refactor!: escape expanded markdown by default (#9463)

feat: support markdown

BREAKING CHANGE: `heading`, `bulletedList`, `numberedList`, `maskedLink` in `EscapeMarkdownOptions` now defaults to `true`.

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Jaw0r3k
2024-12-05 23:43:40 +01:00
committed by GitHub
parent 25633a024e
commit 0ac140cd9f

View File

@@ -14,7 +14,7 @@ export interface EscapeMarkdownOptions {
/** /**
* Whether to escape bulleted lists. * Whether to escape bulleted lists.
* *
* @defaultValue `false` * @defaultValue `true`
*/ */
bulletedList?: boolean; bulletedList?: boolean;
@@ -42,7 +42,7 @@ export interface EscapeMarkdownOptions {
/** /**
* Whether to escape headings. * Whether to escape headings.
* *
* @defaultValue `false` * @defaultValue `true`
*/ */
heading?: boolean; heading?: boolean;
@@ -69,14 +69,14 @@ export interface EscapeMarkdownOptions {
/** /**
* Whether to escape masked links. * Whether to escape masked links.
* *
* @defaultValue `false` * @defaultValue `true`
*/ */
maskedLink?: boolean; maskedLink?: boolean;
/** /**
* Whether to escape numbered lists. * Whether to escape numbered lists.
* *
* @defaultValue `false` * @defaultValue `true`
*/ */
numberedList?: boolean; numberedList?: boolean;
@@ -120,10 +120,10 @@ export function escapeMarkdown(text: string, options: EscapeMarkdownOptions = {}
codeBlockContent = true, codeBlockContent = true,
inlineCodeContent = true, inlineCodeContent = true,
escape = true, escape = true,
heading = false, heading = true,
bulletedList = false, bulletedList = true,
numberedList = false, numberedList = true,
maskedLink = false, maskedLink = true,
} = options; } = options;
if (!codeBlockContent) { if (!codeBlockContent) {