feat(markdown)!: replace markdown-it-emoji with @mdit/plugin-emoji

Same emoji token type, shortcuts, and set-replacement semantics, with
fresher emoji data and native types (drops `@types/markdown-it-emoji`).

BREAKING CHANGE: The `defs` property of `markdown.emoji` has been renamed to `definitions`.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pull/5335/head
Divyansh Singh 1 month ago
parent 85ede55fdb
commit 018887fa1d

@ -112,7 +112,7 @@ For more details, see [Frontmatter](../reference/frontmatter-config).
:tada: :100:
A [list of all emojis](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs) is available.
A [list of all emojis](https://github.com/mdit-plugins/mdit-plugins/blob/main/packages/emoji/src/data/full.ts) is available.
## Table of Contents

@ -112,7 +112,7 @@ Para más detalles, vea [Frontmatter](../reference/frontmatter-config).
:tada: :100:
Una [lista de todos los emojis](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs) está disponible.
Una [lista de todos los emojis](https://github.com/mdit-plugins/mdit-plugins/blob/main/packages/emoji/src/data/full.ts) está disponible.
## Tabla de Contenido (TOC)

@ -112,7 +112,7 @@ lang: fa-IR
:tada: :100:
یک [لیست از همه اموجی ها](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs) در دسترس است.
یک [لیست از همه اموجی ها](https://github.com/mdit-plugins/mdit-plugins/blob/main/packages/emoji/src/data/full.ts) در دسترس است.
## فهرست مطالب {#table-of-contents}

@ -110,7 +110,7 @@ lang: ja-JP
:tada: :100:
すべての絵文字の [一覧はこちら](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs)。
すべての絵文字の [一覧はこちら](https://github.com/mdit-plugins/mdit-plugins/blob/main/packages/emoji/src/data/full.ts)。
## 目次 {#table-of-contents}

@ -112,7 +112,7 @@ lang: en-US
:tada: :100:
[모든 이모지의 목록](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs)이 제공됩니다.
[모든 이모지의 목록](https://github.com/mdit-plugins/mdit-plugins/blob/main/packages/emoji/src/data/full.ts)이 제공됩니다.
## 목차 {#table-of-contents}

@ -112,7 +112,7 @@ Para mais detalhes, veja [Frontmatter](../reference/frontmatter-config).
:tada: :100:
Uma [lista de todos os emojis](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs) está disponível.
Uma [lista de todos os emojis](https://github.com/mdit-plugins/mdit-plugins/blob/main/packages/emoji/src/data/full.ts) está disponível.
## Tabela de Conteúdo (TOC)

@ -112,7 +112,7 @@ lang: ru-RU
:tada: :100:
[Список всех эмодзи](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs).
[Список всех эмодзи](https://github.com/mdit-plugins/mdit-plugins/blob/main/packages/emoji/src/data/full.ts).
## Оглавление {#table-of-contents}

@ -112,7 +112,7 @@ lang: en-US
:tada: :100:
这里可以找到[所有支持的 emoji 列表](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/full.mjs)。
这里可以找到[所有支持的 emoji 列表](https://github.com/mdit-plugins/mdit-plugins/blob/main/packages/emoji/src/data/full.ts)。
## 目录表 (TOC) {#table-of-contents}

@ -130,6 +130,7 @@
"@mdit-vue/plugin-toc": "^3.0.2",
"@mdit-vue/shared": "^3.0.2",
"@mdit/plugin-anchor": "^1.1.1",
"@mdit/plugin-emoji": "^1.1.0",
"@polka/compression": "^1.0.0-next.28",
"@rollup/plugin-alias": "^6.0.0",
"@rollup/plugin-commonjs": "^29.0.3",
@ -141,7 +142,6 @@
"@types/mark.js": "^8.11.12",
"@types/markdown-it-attrs": "^4.1.3",
"@types/markdown-it-container": "^4.0.0",
"@types/markdown-it-emoji": "^3.0.1",
"@types/minimist": "^1.2.5",
"@types/node": "^25.9.4",
"@types/picomatch": "^4.0.3",
@ -162,7 +162,6 @@
"markdown-it-attrs": "4.3.1",
"markdown-it-cjk-friendly": "^2.0.2",
"markdown-it-container": "^4.0.0",
"markdown-it-emoji": "^3.0.0",
"markdown-it-mathjax3": "^4.3.2",
"minimist": "^1.2.8",
"nanoid": "^5.1.16",

@ -116,6 +116,9 @@ importers:
'@mdit/plugin-anchor':
specifier: ^1.1.1
version: 1.1.1(markdown-it@14.2.0)
'@mdit/plugin-emoji':
specifier: ^1.1.0
version: 1.1.0(markdown-it@14.2.0)
'@polka/compression':
specifier: ^1.0.0-next.28
version: 1.0.0-next.28
@ -149,9 +152,6 @@ importers:
'@types/markdown-it-container':
specifier: ^4.0.0
version: 4.0.0
'@types/markdown-it-emoji':
specifier: ^3.0.1
version: 3.0.1
'@types/minimist':
specifier: ^1.2.5
version: 1.2.5
@ -212,9 +212,6 @@ importers:
markdown-it-container:
specifier: ^4.0.0
version: 4.0.0
markdown-it-emoji:
specifier: ^3.0.0
version: 3.0.0
markdown-it-mathjax3:
specifier: ^4.3.2
version: 4.3.2
@ -645,6 +642,15 @@ packages:
peerDependencies:
markdown-it: ^14.2.0
'@mdit/plugin-emoji@1.1.0':
resolution: {integrity: sha512-rdGhZ0OVhK0EhiVpw8v22BdTq7XZ6Adrcbq3hR2Cx/YwGnL+kSXFtcGOeJXphiSics7oNgpIKdNyl974z7Cj1A==}
engines: {node: '>=22'}
peerDependencies:
markdown-it: ^14.2.0
peerDependenciesMeta:
markdown-it:
optional: true
'@napi-rs/wasm-runtime@1.1.6':
resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==}
peerDependencies:
@ -1064,9 +1070,6 @@ packages:
'@types/markdown-it-container@4.0.0':
resolution: {integrity: sha512-GmD8OECLfzPHv8VyvFRzslqdwXoDBJ2H40fxXFjrarbqvJZSB/BJKZXN5e3k7Mx7GQanSNzTYhzeS3H9o0gAOw==}
'@types/markdown-it-emoji@3.0.1':
resolution: {integrity: sha512-cz1j8R35XivBqq9mwnsrP2fsz2yicLhB8+PDtuVkKOExwEdsVBNI+ROL3sbhtR5occRZ66vT0QnwFZCqdjf3pA==}
'@types/markdown-it@14.1.2':
resolution: {integrity: sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==}
@ -2059,9 +2062,6 @@ packages:
markdown-it-container@4.0.0:
resolution: {integrity: sha512-HaNccxUH0l7BNGYbFbjmGpf5aLHAMTinqRZQAEQbMr2cdD3z91Q6kIo1oUn1CQndkT03jat6ckrdRYuwwqLlQw==}
markdown-it-emoji@3.0.0:
resolution: {integrity: sha512-+rUD93bXHubA4arpEZO3q80so0qgoFJEKRkRbjKX8RTdca89v2kfyF+xR3i2sQTwql9tpPZPOQN5B+PunspXRg==}
markdown-it-mathjax3@4.3.2:
resolution: {integrity: sha512-TX3GW5NjmupgFtMJGRauioMbbkGsOXAAt1DZ/rzzYmTHqzkO1rNAdiMD4NiruurToPApn2kYy76x02QN26qr2w==}
@ -3240,6 +3240,12 @@ snapshots:
'@types/markdown-it': 14.1.2
markdown-it: 14.2.0
'@mdit/plugin-emoji@1.1.0(markdown-it@14.2.0)':
dependencies:
'@types/markdown-it': 14.1.2
optionalDependencies:
markdown-it: 14.2.0
'@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)':
dependencies:
'@emnapi/core': 1.11.1
@ -3549,10 +3555,6 @@ snapshots:
dependencies:
'@types/markdown-it': 14.1.2
'@types/markdown-it-emoji@3.0.1':
dependencies:
'@types/markdown-it': 14.1.2
'@types/markdown-it@14.1.2':
dependencies:
'@types/linkify-it': 5.0.0
@ -4521,8 +4523,6 @@ snapshots:
markdown-it-container@4.0.0: {}
markdown-it-emoji@3.0.0: {}
markdown-it-mathjax3@4.3.2:
dependencies:
juice: 8.1.0

@ -15,6 +15,7 @@ import { titlePlugin } from '@mdit-vue/plugin-title'
import { tocPlugin, type TocPluginOptions } from '@mdit-vue/plugin-toc'
import { slugify as defaultSlugify } from '@mdit-vue/shared'
import { anchor as anchorPlugin, type AnchorOptions } from '@mdit/plugin-anchor'
import { fullEmoji as emojiPlugin } from '@mdit/plugin-emoji'
import type {
CodeToHastOptions,
LanguageInput,
@ -24,7 +25,6 @@ import type {
import { MarkdownItAsync, type MarkdownItAsyncOptions } from 'markdown-it-async'
import attrsPlugin, { type MarkdownItAttrsOptions } from 'markdown-it-attrs'
import mditCjkFriendly from 'markdown-it-cjk-friendly'
import { full as emojiPlugin } from 'markdown-it-emoji'
import path from 'node:path'
import type { BuiltinLanguage, BuiltinTheme, Highlighter } from 'shiki'
import type { Logger } from 'vite'
@ -42,6 +42,9 @@ import { tablePlugin } from './plugins/table'
export type { Header } from '../shared'
// not exported from @mdit/plugin-emoji, so derive it from the plugin signature
type EmojiPluginOptions = NonNullable<Parameters<typeof emojiPlugin>[1]>
export type ThemeOptions =
| ThemeRegistrationAny
| BuiltinTheme
@ -180,16 +183,10 @@ export interface MarkdownOptions extends MarkdownItAsyncOptions {
*/
attrs?: MarkdownItAttrsOptions | false
/**
* Options for `markdown-it-emoji`. Set to `false` to disable.
* @see https://github.com/markdown-it/markdown-it-emoji
* Options for `@mdit/plugin-emoji`. Set to `false` to disable.
* @see https://mdit-plugins.github.io/emoji.html
*/
emoji?:
| {
defs?: Record<string, string>
enabled?: string[]
shortcuts?: Record<string, string | string[]>
}
| false
emoji?: EmojiPluginOptions | false
/**
* Improves emphasis (`**bold**`) handling in Japanese, Chinese, and
* Korean text.

Loading…
Cancel
Save