Skip to content

fix(comments): preserve newlines, linkify URLs, render backtick code in comment bodies - #20

Open
Liewzheng wants to merge 3 commits into
cpatrickalves:mainfrom
Liewzheng:fix/comment-rendering
Open

fix(comments): preserve newlines, linkify URLs, render backtick code in comment bodies#20
Liewzheng wants to merge 3 commits into
cpatrickalves:mainfrom
Liewzheng:fix/comment-rendering

Conversation

@Liewzheng

Copy link
Copy Markdown

Description

Three small comment-rendering fixes in the comment create/update body conversion (all in the same formatter path, so one PR to avoid self-conflicts):

  1. Newlines preserved\n in --body now becomes <p>/<br> structure instead of collapsing into one block (fix: comment body newlines are lost (stored as raw HTML without <br>/<p>) #17).
  2. Bare URLs linkifiedhttps://… in --body is wrapped in <a href> (fix: bare URLs in comment bodies are not linkified #18).
  3. Backtick code spans rendered`inline` and fenced blocks convert to <code>/<pre><code> (fix: backtick code spans in comment bodies render literally #19).

Test Scenarios

  • uv run pytest — 194 passed, including new cases per fix.
  • Verified end-to-end against a self-hosted Plane CE 1.4.2 instance: comments created via CLI render newlines, clickable links and code spans correctly in the web UI.

References

comment create/update wrapped the whole body in a single p tag; the
editor collapses whitespace inside a paragraph, so multi-line comments
(numbered items, link lists) rendered as one long line. Blank lines now
split into separate paragraphs, single newlines become br tags.
The API stores comment HTML verbatim and does not auto-link URLs — only
the web editor does — so links posted via the CLI rendered as plain text.
Bare http(s) URLs now become anchors; trailing sentence punctuation stays
outside the link, and URLs already inside an anchor are left alone.
The editor stores HTML and does not parse markdown, so `branch` and
fenced blocks posted via the CLI showed literal backticks. Inline code
becomes an escaped code tag (never linkified); fenced blocks become
pre-wrapped code and keep their own paragraph.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant