diff --git a/docs/core-checklist-status.md b/docs/core-checklist-status.md index 3fefa8b..18893b4 100644 --- a/docs/core-checklist-status.md +++ b/docs/core-checklist-status.md @@ -28,7 +28,7 @@ Legend: 19. Stickers - `PARTIAL` (web sticker picker with preset pack + favorites) 20. GIF - `PARTIAL` (web GIF picker with Tenor search + preset fallback + favorites) 21. Message History/Search - `DONE` (history/pagination/chat+global search) -22. Text Formatting - `PARTIAL` (bold/italic/underline/spoiler/mono/links supported; toolbar still evolving) +22. Text Formatting - `PARTIAL` (bold/italic/underline/spoiler/mono/links + strikethrough + quote/code block; toolbar still evolving) 23. Groups - `PARTIAL` (create/add/remove/invite link; advanced moderation partial) 24. Roles - `DONE` (owner/admin/member) 25. Admin Rights - `PARTIAL` (delete/ban-like remove/pin/edit info; full ban system limited) diff --git a/web/src/components/MessageComposer.tsx b/web/src/components/MessageComposer.tsx index 910d531..d40ae60 100644 --- a/web/src/components/MessageComposer.tsx +++ b/web/src/components/MessageComposer.tsx @@ -872,6 +872,31 @@ export function MessageComposer() { }); } + function insertQuoteBlock() { + const textarea = textareaRef.current; + if (!textarea) { + return; + } + const start = textarea.selectionStart ?? text.length; + const end = textarea.selectionEnd ?? text.length; + const selected = text.slice(start, end); + const source = selected || "quote"; + const quoted = source + .split("\n") + .map((line) => `> ${line}`) + .join("\n"); + const nextValue = `${text.slice(0, start)}${quoted}${text.slice(end)}`; + setText(nextValue); + if (activeChatId) { + setDraft(activeChatId, nextValue); + } + requestAnimationFrame(() => { + textarea.focus(); + const pos = start + quoted.length; + textarea.setSelectionRange(pos, pos); + }); + } + return (
${value}`);
+ continue;
+ }
+ const lines = part.split("\n");
+ for (let lineIndex = 0; lineIndex < lines.length; lineIndex += 1) {
+ const line = lines[lineIndex];
+ if (line.startsWith("> ")) {
+ blocks.push(`${parseInline(line.slice(2))}`); + } else { + blocks.push(parseInline(line)); + } + if (lineIndex < lines.length - 1) { + blocks.push("