fix: preserve lexer state when re-lexing quoted list continuations #4290
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 256 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.332
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4290"
general
weight: 0.35
UziTech
Marked version: 18.2.0 - 18.3.0
Markdown flavor: CommonMark|GitHub Flavored Markdown
Description
When a blockquote inside a list item follows a
texttoken and has a lazy continuation line,_Tokenizer.blockquotecallsthis.lexer.blockTokens(currentText, tokens, true)(which restoresstate.lastTokento the outer list item'stexttoken) and then callsthis.list(newText)/this.blockquote(newText)directly. Seeing the stale outertexttoken aslastToken,this.list(newText)returnedundefinedfor ordered lists starting above1(or0/ empty items), throwingTypeError: Cannot read properties of undefined (reading 'raw').this.list(newText)could also leavestate.top = true, affecting a following indented sibling line in a tight list item.This saves
outerLastTokenin_Tokenizer.blockquote, setsstate.lastToken = tokens.at(-2)(andinBlockquote = true) before re-lexing continuation lines, and restorestop,inBlockquote, andlastTokenafterward.Demo links (
- a\n > 2. b\nc,{"gfm":true}):Contributor
test/specs/new/blockquote_list_lazy_in_list_item.{md,html}); or,Committer
In most cases, this should be a different person than the contributor.