Commit 0cde999
committed
Fix apiQuery reconstruction to preserve quoted phrases byte-for-byte
The previous split(/\s+/) + join approach would break GitHub quoted phrases
(e.g. "feature flag" /from.*axios/) by splitting 'feature flag' into two
separate tokens and losing the quote grouping.
Fix: use q.replace(raw, term).trim() to replace only the regex token in-place,
leaving every other character in the original query unchanged. This preserves
quoted phrases, extra whitespace handling, and all qualifiers byte-for-byte.
Regression test added:
'"feature flag" /from.*axios/' → '"feature flag" axios'1 parent 0a3a77e commit 0cde999
2 files changed
+13
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
72 | 67 | | |
73 | 68 | | |
74 | 69 | | |
| |||
0 commit comments