Skip to content

Nest multi-line return values under the "- Returns: " field - #4023

Merged
Foesa-yyx merged 1 commit into
masterfrom
fix-returns-list-nesting
Oct 9, 2026
Merged

Foesa-yyx merged 1 commit into
masterfrom
fix-returns-list-nesting

Conversation

@saudsami

@saudsami saudsami commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #4021, found by building the Lite SDK archive for real rather than inspecting the template.

The problem

iris_doc writes the return value after - Returns: on the same line, so the Markdown list #4021 introduced collided with it:

 * - Returns: - 0: Success.      ← first item absorbed into the Returns line
 * - < 0: Failure.               ← falls out of the Returns block entirely

What DocC produced for pauseAllChannelMediaRelay():

section content
Return Value - 0: Success. — literal dash, rendered as prose
Discussion < 0: Failure. — orphaned into the wrong section

55 pages in the Lite archive were affected, 0 correct. That's worse than the single-line output it replaced, so this should land before any archive is published.

The fix

indent_for_inline_field() starts a multi-line value on the next line, indented two spaces, so it nests under the field rather than escaping it:

"\n  - 0: Success.\n  - < 0: Failure."

Three rules in replace_newline() were silently undoing this — two stripping a leading newline after : " (there are duplicates), and one collapsing the indent. They now take platform_tag and keep a deliberate newline-plus-indent only for the Markdown platforms.

That gating matters: replace_newline() runs for every platform, unlike the #4021 changes which sat behind MARKDOWN_PLATFORMS. A first attempt applying the exceptions unconditionally shifted unity, flutter, rn and electron by 11–68 bytes. Non-Markdown platforms now use the original patterns verbatim, so they can't drift by construction.

Verification

Regenerated against en-US/dita/RTC-NG:

platform result
unity, flutter, rn, electron byte-identical to master
ios 461 of 461 multi-line returns nested (0 before)

How this was found

Dispatching deploy_docs.yml on AgoraLite_iOS produced a real archive. The discussion improvements from #4021 all worked — 34 asides, 76 lists, 93 sub-headings, where the live archive has none — confirming Markdown survives iris_doc → xcodebuild → DocC. The return values were the one thing that broke, and only a real build could show it.

No release assets were touched; the stale 4.7.0 archives are still in place.

🤖 Generated with Claude Code

Follow-up to #4021, found by building the Lite SDK archive for real.

iris_doc writes the return value after "- Returns: " on the same line, so the
Markdown list #4021 introduced collided with it. DocC absorbed the first item
into the Returns line and dropped the rest into the discussion:

  Return Value : "- 0: Success."        rendered as prose, dash and all
  Discussion   : < 0: Failure.          orphaned, in the wrong section

55 pages in the Lite archive were affected and none were correct, which is
worse than the single-line output it replaced.

indent_for_inline_field() starts a multi-line value on the next line and
indents it two spaces, so it nests under the field instead of escaping it:

  "\n  - 0: Success.\n  - < 0: Failure."

Three rules in replace_newline() were silently undoing that -- two stripping a
leading newline after ': "', and one collapsing the indent. They now take the
platform and keep a deliberate newline plus two-space indent only for the
Markdown platforms; every other platform keeps the original patterns verbatim.

That matters because replace_newline() runs for every platform, unlike the
#4021 changes which were gated behind MARKDOWN_PLATFORMS. A first attempt that
applied the exceptions unconditionally shifted unity, flutter, rn and electron
by 11-68 bytes.

Verified by regenerating against en-US/dita/RTC-NG:

  unity, flutter, rn, electron   byte-identical to master
  ios                            461 of 461 multi-line returns now nested
                                 (0 before)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Foesa-yyx
Foesa-yyx merged commit 256755a into master Oct 9, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants