fix(docs): expand inline markdown inside table cells#612
Merged
Conversation
Closes openclaw#608. `InsertNativeTable` inserted raw cell content via a single InsertText request, so `**bold**`, `*italic*`, `` `code` ``, and `[links]` inside a markdown table cell rendered as literal characters. Outside of tables the same converter already runs `ParseInlineFormatting` and emits per- span `UpdateTextStyle` requests; this change applies that same pipeline to table cells. Extracted the per-cell request construction into a pure `buildTableCellRequests(cellContent, cellIdx, isHeaderRow)` so the inline-formatting expansion is directly unit-testable without HTTP mocking. The header-row whole-cell bold is preserved and the running cell indices in `updateIndicesAfter` now shift by the UTF-16 length of the actual stripped text rather than the original markdown. Tests cover **bold**, *italic*, `code`, plain text, header-row bold, and the marker-only cell that strips to "". Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
steipete
force-pushed
the
fix/608-table-cell-inline-md
branch
from
May 20, 2026 19:56
ab3e6c5 to
32f74d4
Compare
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.
Closes #608.
Root cause
InsertNativeTableinserted raw cell content via a singleInsertTextrequest, so**bold**,*italic*,`code`, and[links]inside a markdown table cell rendered as literal characters. Outside of tables the converter already runs `ParseInlineFormatting` and emits per-span `UpdateTextStyle` requests — this PR runs the same pipeline on table cells.Change
Extracted the per-cell request construction into a pure helper:
```go
buildTableCellRequests(cellContent string, cellIdx int64, isHeaderRow bool) ([]*docs.Request, int64)
```
so the inline-formatting expansion is directly unit-testable without HTTP mocking. The header-row whole-cell bold is preserved, and the running cell indices in `updateIndicesAfter` now shift by the UTF-16 length of the stripped text rather than the original markdown (since markers are gone from the inserted text).
Tests
+ "code" +`.`go test ./internal/cmd/ -count=1` → ok 24.2s.