mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +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.
|
* 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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user