Files
outline/shared/editor/rules/emoji.ts
codegen-sh[bot] e21bd23bd8 Update markdown-it to 14.1.0 and markdown-it-emoji to 3.0.0 (#9541)
* Update markdown-it to 14.1.0 and markdown-it-emoji to 3.0.0

- Updated markdown-it from ^13.0.2 to ^14.1.0
- Updated markdown-it-emoji from ^2.0.0 to ^3.0.0
- Fixed emoji plugin import to use new named export syntax
- Changed from 'import emojiPlugin from "markdown-it-emoji"' to 'import { full as emojiPlugin } from "markdown-it-emoji"'
- Verified builds and tests pass successfully

* Update @types/markdown-it-emoji to 3.0.1

- Updated @types/markdown-it-emoji from ^2.0.4 to ^3.0.1 to match the updated markdown-it-emoji package
- This ensures TypeScript definitions are compatible with the new plugin signature

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
2025-07-04 08:12:16 -04:00

23 lines
708 B
TypeScript

import MarkdownIt from "markdown-it";
import { full as emojiPlugin } from "markdown-it-emoji";
import { nameToEmoji } from "../lib/emoji";
type Options = MarkdownIt.Options & {
emoji: boolean;
};
export default function emoji(md: MarkdownIt) {
// Ideally this would be an empty object, but due to a bug in markdown-it-emoji
// passing an empty object results in newlines becoming emojis. Until this is
// fixed at least one key is required. See:
// https://github.com/markdown-it/markdown-it-emoji/issues/46
const noMapping = {
no_name_mapping: "💯",
};
return emojiPlugin(md, {
defs: (md.options as Options).emoji === false ? noMapping : nameToEmoji,
shortcuts: {},
});
}