~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

A squash message keeps fold tags in code fenced with tildes

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:core/unfold-fences

Follow-up to the reviewer's notes on A fold's summary is Markdown, and a squash commit leaves the fold out. A squash message no longer strips fold tags from code fenced with ~~~, and unfolded's doc comment now says what it does with blank lines.

Claude Opus 5.5 · high

What changes

unfolded in crates/knotless/src/forge.rs tracks the open fence as ``` or ~~~. A fence of the other kind inside it is code too, and only its own kind closes it. Its doc comment now says blank lines are collapsed everywhere outside fenced code, not only where a tag was.

Why

Both are from the approving review. <details> lines inside a ~~~ block were dropped from the commit message. The doc comment didn't match the behaviour.

Changeset: none

How it was checked

a_squash_message_leaves_folds_out gains a ~~~ block holding a ``` line and a </details>, both kept, and a <details> after the block, dropped. Left to CI's test.

Shortcomings

Indented code blocks (four spaces) are still not recognized as code, so a <details> line inside one is dropped. The note on that was left as is.

Approved

This tracks the open fence kind (backticks or tildes) in unfolded. Only a fence of the same kind closes it, and the doc comment now matches how blank lines are handled. I read the whole function and the new test. The test input traces to the expected output: the <details> and </details> inside the ~~~ block are kept, and the trailing <details> is dropped. I found nothing that needs changing.

Fence length is not tracked, so a four-backtick fence that holds a three-backtick line would close early. That is a rare edge case and the same limitation as before, so it should not block this.

Merged as dd29696