mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user