docs(man): preserve markdown list/code block structure in DESCRIPTION#13391
docs(man): preserve markdown list/code block structure in DESCRIPTION#13391Cris682 wants to merge 1 commit into
Conversation
|
Thanks for your pull request! Unfortunately, it doesn't meet the requirements for review:
Please update your PR to address the above. This PR will be automatically closed in 4 days if these requirements are not met. Full contribution requirements
|
There was a problem hiding this comment.
Pull request overview
This pull request updates the manpage generator to preserve Markdown block structure in DESCRIPTION sections by normalizing cmd.Long before converting it with md2man, preventing lists and code blocks from being flattened into paragraphs.
Changes:
- Added
normalizeMarkdownForMan()and supporting helpers to insert missing blank lines before Markdown block starts (lists, fenced code blocks, indented code blocks), while avoiding changes inside fenced code blocks. - Applied this normalization when writing the
# DESCRIPTIONcontent ininternal/docs/man.go. - Added unit tests covering normalization behavior and an integration-style assertion that rendered man output contains bullet list formatting.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/docs/man.go | Normalizes cmd.Long Markdown to preserve block formatting in manpage DESCRIPTION rendering. |
| internal/docs/man_test.go | Adds tests for Markdown normalization and verifies bullet lists render as list items in man output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for the automated checks and review. This PR fixes #13343 (manpage DESCRIPTION formatting for markdown lists/code blocks) with a minimal, targeted change in:
I understand the external contribution policy requires linking an issue with the
Happy to adjust/close/reopen based on maintainer guidance. Thanks! |
Audit-driven fixes to the GitHub provider. GitLab path is byte-identical
— pinned by 5 regression-guard tests covering anchor format, leap-message
notation, env-var placeholder, and abstract-method signatures.
Read-path fixes:
- Anchor format: deep-links use #discussion_r<id> for review comments and
#issuecomment-<id> for conversation comments (was unconditionally
#note_<id>, the GitLab format, so on GitHub the page loaded but never
scrolled to the comment).
- Fork PR tracking: PR-pinned rows store pr_iid; providers fetch by IID
to bypass the head filter (which excludes fork PRs by design on
GitHub). Auto-tracked rows still use the head filter — no perf
regression for branches without a PR.
- branch_deleted check queries pr.head.repo (the fork) instead of the
base repo, so fork PRs aren't falsely flagged as deleted.
- PR conversation tab: pr.get_issue_comments() now feeds unresponded
count, /leap detection, and "Send comments to session". A
discriminated discussion_id ('r:<id>' / 'i:<id>') routes acks to the
right API endpoint.
- Resolved review threads filtered via GraphQL (REST v3 doesn't expose
isResolved). Paginates up to 300 threads.
- Emoji reactions on the last other-party comment count as ack — parity
with GitLab's award_emoji semantics.
- Notification URL handles /commits/ → /commit/, falls back to repo URL
for unknown subject types (releases, workflow runs, …).
- format_leap_message uses '#N' for GitHub PRs, keeps '!N' for GitLab.
UX/setup-dialog fixes:
- Per-provider env-var placeholder (was hardcoded GITLAB_TOKEN; GitHub
dialog now correctly says GITHUB_TOKEN).
- Explicit api.github.com / github.com URLs no longer auto-check
"Self-hosted" on next dialog open.
- /meta server check accepts 401/403 as proof-of-GitHub so bad-token
errors aren't masked as "not GitHub".
- Token scope check accepts public_repo as valid alongside repo.
- UserNotification.author='' explicitly (was None — GitHub
notifications API doesn't expose actor without an extra fetch we
don't pay for).
Tests: 41 new unit tests (36 GitHub-focused + 5 GitLab regression
guards) covering pure-logic surface end-to-end. Live read-only sanity
run against cli/cli/pull/13391 (a fork PR with an unresponded
issue-tab comment) exercised every read path on real data.
Commit Title
docs(man): preserve markdown block formatting in DESCRIPTION sections
Commit Message
The manpage generator now normalizes command
Longdescriptions before passing them tomd2man.This fixes formatting issues where markdown blocks in
DESCRIPTIONwere flattened into hard-to-read paragraphs, especially:What changed
normalizeMarkdownForMan()ininternal/docs/man.gonormalizeMarkdownForMan(cmd.Long)instead of rawcmd.LongTests
TestNormalizeMarkdownForManAddsMissingBlockSeparatorsTestRenderManFormatsDescriptionListsgo test ./internal/docs/...go test ./cmd/gen-docs/...Scope
internal/docs/man.gointernal/docs/man_test.goIssue
Fixes #13343