Repository navigation
Conversation
Parse `<kbd>...</kbd>` keyboard-shortcut tags in Markdown as a single atomic span (the same way backtick code spans are matched) and render them using the existing inline-code visual treatment, rather than introducing a new style marker. This is a narrower re-scope of warpdotdev#13733 per maintainer feedback on the prior attempt (warpdotdev#13916): no changes to the editor buffer model, style markers, serialization, or paste path — parser recognition only, using FormattedTextFragment::inline_code so both the GUI Markdown viewer and the TUI renderer pick it up for free through the shared style field.
Regression test adapted from warpdotdev#13916's table_offset_map_tests.rs case, updated for the inline-code-dispatch design: verifies the table cell offset map skips <kbd>/</kbd> source markers correctly (mapping rendered "Press Cmd+K" back to source positions), same as it already does for backtick code spans and other inline markers.
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR updates the Markdown parser so exact-case <kbd>...</kbd> spans are parsed as atomic inline-code fragments, with tests covering parser behavior and table-cell offset mapping.
Concerns
- For this user-facing Markdown rendering change, please include screenshots or a short screen recording demonstrating the rendered
<kbd>styling end to end. The PR description says screenshots are still pending, and the provided review artifacts do not include visual evidence.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
Screenshot now attached to the description /oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
Oz no longer requests changes for this pull request after the latest automated review.
There was a problem hiding this comment.
Overview
This PR updates the Markdown parser to recognize exact-case <kbd>...</kbd> spans as atomic inline-code-styled fragments and adds parser plus table offset-map coverage for the issue case.
Concerns
- No blocking concerns found. The PR includes screenshot evidence for the user-visible rendering change and focused unit coverage for normal, adjacent, empty, unmatched, and non-nesting
<kbd>behavior.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
@bnavetta This PR is still waiting for review. (Just trying to avoid the stale-bot) |
Closes #13733
Recognizes
<kbd>...</kbd>keyboard-shortcut tags in the Markdown parser and renders them using the existing inline-code visual treatment, rather than adding a new style marker.This is a narrower re-scope of my earlier attempt (#13916) per @kevinyang372's feedback there — no changes to the editor buffer model, style markers, serialization, or paste path.
<kbd>is parsed as a single atomic span the same way backtick code spans already are, and dispatches to the existingFormattedTextFragment::inline_code, so both the GUI Markdown viewer and the TUI renderer pick up the styling for free through the shared style field — no per-surface wiring needed.One tradeoff from going this route:
<kbd>no longer nests with bold/italic (e.g.<kbd>**Cmd**</kbd>renders as literal text rather than bold-in-a-keycap), since avoiding the delimiter-stack machinery was the point. Tags are also matched exact-case, matching this parser's existing<u>/</u>precedent, rather than case-insensitively.Testing:
cargo nextest run -p markdown_parser(156 passed),-p warp_editor(486 passed, including a new table-cell offset-map regression test for<kbd>spans),-p warp_tui(832 passed);cargo clippy --all-targets --all-features --tests -- -D warningsclean;./script/format --checkclean.CHANGELOG-IMPROVEMENT: Markdown Viewer now renders
<kbd>keyboard-shortcut tags using inline-code styling instead of literal text.Screenshot now attached:
