feat: add LTR/RTL in hashtags and mentions support (#2541)
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
b016320eaf
commit
3adf92ea56
6 changed files with 202 additions and 106 deletions
|
@ -72,6 +72,8 @@ const sanitizer = sanitize({
|
|||
/**
|
||||
* Parse raw HTML form Mastodon server to AST,
|
||||
* with interop of custom emojis and inline Markdown syntax
|
||||
* @param html The content to parse
|
||||
* @param options The parsing options
|
||||
*/
|
||||
export function parseMastodonHTML(
|
||||
html: string,
|
||||
|
@ -140,6 +142,8 @@ export function parseMastodonHTML(
|
|||
|
||||
/**
|
||||
* Converts raw HTML form Mastodon server to HTML for Tiptap editor
|
||||
* @param html The content to parse
|
||||
* @param customEmojis The custom emojis to use
|
||||
*/
|
||||
export function convertMastodonHTML(html: string, customEmojis: Record<string, mastodon.v1.CustomEmoji> = {}) {
|
||||
const tree = parseMastodonHTML(html, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue