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