1.7 KiB
1.7 KiB
RosterChirp — Future Feature Requests
Markdown Message Rendering
Request: Render markdown-formatted text in the message window.
Scope recommendation: Start with inline-only markdown (bold, italic, inline code, strikethrough, links). Full block-level markdown (headers, lists, tables, code blocks) is a follow-on.
Why inline-only first
- Zero risk of misformatting existing plain-text messages
- Full markdown risks rendering existing content oddly (e.g. a message starting with
1.or#rendering as a list/header)
Implementation notes
- Integration point is
formatMsgContent()inMessage.jsx— already returns HTML fordangerouslySetInnerHTML; a markdown parser slots straight in - Add
markednpm package (~13KB) for parsing - Add
DOMPurifyfor XSS sanitization — required, markdown allows raw HTML passthrough and content comes from other users markedconfig:{ breaks: true }to preserve single-newline-as-<br>behaviour,{ mangle: false, headerIds: false }to suppress heading anchors- Apply markdown parse first, then @mention substitution (so
**@[Name]**renders correctly) - Remove the existing URL regex linkifier in
formatMsgContent— markdown handles links natively - Strip markdown from reply previews (currently shows raw
**text**) handleCopycopiesmsg.content(raw markdown source) — correct behaviour, no change needed- Emoji-only detection runs on raw content before rendering — no change needed
- Compose box stays plain textarea for v1; no preview toolbar required
Effort estimate
| Scope | Estimate |
|---|---|
| Inline-only (bold, italic, code, strikethrough) | ~1.5 hours |
| Full markdown (+ block elements, CSS for bubbles) | ~4–5 hours |