Skip to main content

max / makenotwork

Match the code element the renderer emits, not the one the template had 8cc7e639 moved 26 templates' inline <code> through crate::quasi::literal, so the element is quasi-webview's now and carries a class. The backup-code extractor searched for the bare "<code>", found nothing, and reported the codes as absent: eight TOTP tests failed on "Should have backup codes" while the page was rendering correctly the whole time. Match "<code" and skip to the end of the tag, so the extractor reads the element rather than one spelling of it.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session
https://claude.ai/code/session_01MptwXZ8k65v19rFmdGAyki
Author: Max Johnson <me@maxj.phd> · 2026-09-03 03:39 UTC
Signed with PGP, not checked
Commit: 33c59fafba12403d27a0d2064e594c70aac1b7c7
Parent: c945929
1 file changed, +8 insertions, -2 deletions
@@ -31,8 +31,14 @@
31 31
32 32 let mut codes = Vec::new();
33 33 let mut search = grid_content;
34 - while let Some(code_start) = search.find("<code>") {
35 - let content_start = code_start + "<code>".len();
34 + // `<code` and not `<code>`: the codes go through `crate::quasi::literal`
35 + // now, so the element is the renderer's and it carries a class. Matching
36 + // the bare tag silently found nothing and the codes read as absent.
37 + while let Some(tag_start) = search.find("<code") {
38 + let open_end = search[tag_start..]
39 + .find('>')
40 + .expect("Unterminated <code tag in backup codes");
41 + let content_start = tag_start + open_end + 1;
36 42 let content_end = search[content_start..]
37 43 .find("</code>")
38 44 .expect("Unclosed <code> in backup codes");