Repository navigation
Start a new paragraph when an HTML block tag opens in paste - #1489
h-a-n-a-s-h-i merged 1 commit into
Conversation
Found while testing crates/engine/src/cmd/richclip.rs:121-170 (html_to_body, opening-tag handling; is_block at :190) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Opening block tag paragraph boundaries crates/engine/src/cmd/richclip.rs |
Opening block tags now start a new paragraph. A test checks that text before opening div, p, li, and h1 tags is separate from the block contents. |
Priority:
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix
Suggested reviewers: dylanmtaylor
Merge Risk: 
Minimal · up to fd102
-
The change implements the intended paragraph separation, with no established merge-blocking risk.
Architecture risk: 
Medium · up to fd102
-
The change affects 1 system.
Changed systems:
cratesArchitecture concerns
No architecture-level concerns identified.Review details
-
Systems and components
- observed — crates (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in crates/engine/src/cmd/richclip.rs: Opening block tags now start a new paragraph; previously only closing block tags did so.
- observed — Modified behavior in crates/engine/src/cmd/richclip.rs: Added a test asserting that text before an opening
div,p,li, orh1is in a separate paragraph from the tag’s contents.
Reliability and maintainability
- inferred — Risk-relevant change factors for crates: blast_radius_2; direct_dependents_2
-
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
On Linux, I ran |
|
Landed on main, thank you @Silvertree2010 for the contribution! If you haven't already, come join us on Discord: https://discord.gg/artcraft |
Found while testing
crates/engine/src/cmd/richclip.rs:121-170 (html_to_body, opening-tag handling; is_block at :190)(no existing issue): HTML paste glues text that comes before a block tag to the text inside it.Cause
html_to_bodyonly callednew_parawhen a block tag closed (</div>,</p>,</li>,</h1>and so on). Opening tags never started a paragraph, so text before a block tag was glued to the text inside it (Hello<div>world</div>becameHelloworld).Fix
In the opening-tag path,
html_to_bodynow callsnew_parawhenis_block(&name)is true.new_paradoes nothing when the current paragraph is empty, so adjacent or nested block tags don't produce empty paragraphs. The regression test coversdiv,p,liandh1.Verified
cmd::richclip::tests::text_before_opening_block_tag_is_separate_paragraph: fails onmainwithout the fix and passes with it (cargo test -p deckcraft-engine --lib text_before_opening_block_tag_is_separate_paragraph).cargo xtask cipasses exceptbackstage::tests::start_screen_opens_the_palette_and_preferences, which also fails onmainwithout this change.Not changed
The closing-tag handling, the
br/hrhandling and the tag lists (is_block,tag_kind) are unchanged.🤖 Generated with AI by ApolloOffice, see the Co-Authored-By trailers for the models
Summary by CodeRabbit