-
-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: render custom server emojis on editor #579
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for elk-zone ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
composables/content-parse.ts
Outdated
@@ -1,6 +1,7 @@ | |||
import type { Emoji } from 'masto' | |||
import type { Node } from 'ultrahtml' | |||
import { TEXT_NODE, parse, render, walkSync } from 'ultrahtml' | |||
import { currentCustomEmojisObject } from '~/composables/emojis' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This moudle should avoid referenceing any runtime logic to keep the function pure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll move logic to ContentRich.setup.ts
module, but the registry will be on each instance...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what case this is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we receive custom emojis from another server: check the video on elk editor room
/** | ||
* Add an emoji. | ||
*/ | ||
setEmoji: (options: { src: string; alt?: string; title?: string }) => ReturnType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should add width
, height
and data-emoji-id
here
It is a custom extension for
@tiptap/extension-image
(doesn't support set custom attrs on the image).Added checking custom server emojis stored on local storage when parsing html.