chadtmiller.com/knotless
git that lives in your Atmosphere account
1
10
A fold's summary is Markdown, and a squash commit leaves the fold out
Merged Approved
This pull parses a <summary>'s text as one-line Markdown on the pages and in the iOS app. It also strips the <details> and <summary> tags from squash commit messages, and the docs and changeset are updated. I traced the code and found nothing wrong.
summary/unfoldedinweb.rs: the summary is detected correctly from the stack top before each tag. Anything beyond one inline paragraph falls back to escaped text, and links in a summary still pass through thejavascript:rewrite becausefoldsnow runs before it. Raw HTML text is escaped once, so the old double-escape is gone.- iOS:
inline(_:)exists inMarkdown.swiftand returnsText, which matches the newFoldedMarkdownsignature. I could not build the app here. unfolded/fold_lineinforge.rs: the cases I traced agree with the new test, including mixed-case tags,<details open>, a tag with trailing words kept as-is, and fenced code left alone.
Minor notes you can leave:
- Only ``` fences are tracked, so
~~~fences and indented code that contain<details>lines are stripped. - Blank lines are collapsed everywhere outside fences, not only where a tag was. The doc comment on
unfoldedsays only the latter.
I did not run the checks. The test check holds the 100% coverage gate.
Approved
Since my approval at 59e3241 the only change is in a web.rs test. The raw-HTML-never-linked assertion now includes & and expects &, so it also checks that the text is escaped. That matches the behaviour I traced before, and nothing I approved is affected. I did not run the checks.
All checks have passed
8 passed, 2 skipped
Merged as 0d75c70
Follow-up to the
<details>folds. What a summary says is now Markdown on one line (emphasis, code, links) on the pages and in the iOS app. A squash commit leaves the fold tags out of its message, sogit logreads cleanly. I checked a Mermaid diagram inside a closed fold: it draws correctly once the fold is opened, so it needed no change.Claude Opus 5.5 · high
What changes
Pages.
drawnincrates/knotless-serve/src/web.rsnow runsfoldsfirst, before autolinking and link rewriting. A summary's text is parsed by the newsummaryfunction: one paragraph of emphasis, strong, strikethrough, code and links becomes those events. Anything more (a heading, a list, a picture) is shown as text, and HTML inside a summary is escaped. Since the later steps see the summary's links, ajavascript:link becomes#as it does anywhere else, and bare addresses and mentions are linked. Other raw HTML text is now written escaped as anHtmlevent instead ofText, so nothing later links inside it. Before, the references and mentions steps saw it.iOS.
FoldedMarkdowndraws the summary withMarkdownView.inline, the same inline Markdown as paragraphs.Squash commits.
squash_commitincrates/knotless/src/forge.rspasses the body through the newunfoldedfunction. That covers bothknotless pull mergeon a linear branch and the merge queue. It drops lines that are only<details>,<details open>or</details>. It replaces<summary>…</summary>, alone or with those tags on the same line, with the summary's words. It collapses the blank lines left behind and trims the ends. Fenced code is untouched.Why
These are the three shortcomings the previous pull listed. GitHub shows a summary's Markdown literally; this draws it, which suits a summary like "Claude Opus 5.5 ·
high". The squash message is whatmain's log keeps, and tags there are noise.How it was checked
details_fold_a_part_awaynow covers summary Markdown: bold, code, ajavascript:link made#, an autolinked address, a heading, a picture and inline HTML left as text, a blank summary, and raw HTML text never linked. Left to CI'stest.a_squash_message_leaves_folds_outin forge.rs: tags dropped, summary kept, fenced<details>and blank lines inside code kept, a fold with nothing in it leaves an empty body. Left to CI.just look pull-openwith a diagram in a closed fold, clicked open on a phone in dark mode. It is drawn whole at the fold's width, soweb/src/lib/mermaid.tsis unchanged.just ios-look pull-openwith a summary holding bold and code.Shortcomings