Commit e65bb1d
refactor(docs): replace callout regex with line-based scanner
Sonar S5852 flagged /^:::(note|tip|warning)\s*\n([\s\S]*?)\n:::/gm as
super-linear-runtime-by-backtracking. The lazy quantifier with a clear
terminator isn't actually catastrophic, and markdown bodies are
build-time-bundled (no user input), so this isn't reachable as DoS. But
removing the regex entirely is cheaper than arguing.
The replacement walks lines, finds open/close markers, and emits the
same <aside> output. No quantifiers, obviously linear.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 52be369 commit e65bb1d
1 file changed
Lines changed: 40 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
75 | 86 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
81 | 115 | | |
82 | 116 | | |
83 | 117 | | |
| |||
0 commit comments