Expand description
Markdown → ClickUp comment rich-text conversion.
ClickUp’s Comments API does not render markdown. The comment_text
field is run through a lossy auto-formatter that turns every backtick span
into a fragmented inline-code chip and drops everything else; the
markdown_content field (which works for task descriptions) is silently
ignored on comments. See https://developer.clickup.com/docs/comments.
The only way to get clean rendering is the structured comment array — a
Quill Delta-style list of {text, attributes} runs. Inline marks (code, bold) attach to the content run;
block marks (code-block, list) attach to the trailing "\n" separator
that closes the line. See https://developer.clickup.com/docs/comment-formatting.
This module converts the markdown subset our comments use — inline code,
bold, italic, links, fenced code blocks, bullet/ordered/task lists, ATX
headings, blockquotes, horizontal rules, GFM tables, and plain paragraphs —
into that array. ClickUp comments have no table block, so GFM tables render
as an aligned monospace code-block. Anything it doesn’t recognise is
emitted as plain text, so output is never worse than the old behaviour.
Structs§
- Code
Block Attr - Comment
Attributes - Formatting marks for a single run. Inline marks (
code,bold) sit on a content run; block marks (code_block,list) sit on a"\n"separator. - Comment
Block - One run in a ClickUp comment’s
commentarray. - List
Attr
Functions§
- markdown_
to_ comment_ blocks - Convert a markdown comment body into ClickUp’s
commentrich-text array.