fix(comments): preserve newlines, linkify URLs, render backtick code in comment bodies - #20
Open
Liewzheng wants to merge 3 commits into
Open
fix(comments): preserve newlines, linkify URLs, render backtick code in comment bodies#20Liewzheng wants to merge 3 commits into
Liewzheng wants to merge 3 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
\nin--bodynow becomes<p>/<br>structure instead of collapsing into one block (fix: comment body newlines are lost (stored as raw HTML without <br>/<p>) #17).https://…in--bodyis wrapped in<a href>(fix: bare URLs in comment bodies are not linkified #18).`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.References