mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-14 03:00:29 +03:00
Fix editor bugs (#1281)
* focus editor on reply click * fix emoji and sticker img object-fit * fix cursor not moving with autocomplete * stop sanitizing sending plain text body * improve autocomplete query parsing * add escape to turn off active editor toolbar item
This commit is contained in:
parent
6d199244ef
commit
2883b4c35b
9 changed files with 69 additions and 22 deletions
|
|
@ -88,7 +88,7 @@ const elementToPlainText = (node: CustomElement, children: string): string => {
|
|||
|
||||
export const toPlainText = (node: Descendant | Descendant[]): string => {
|
||||
if (Array.isArray(node)) return node.map((n) => toPlainText(n)).join('');
|
||||
if (Text.isText(node)) return sanitizeText(node.text);
|
||||
if (Text.isText(node)) return node.text;
|
||||
|
||||
const children = node.children.map((n) => toPlainText(n)).join('');
|
||||
return elementToPlainText(node, children);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue