@diegovelasquezweb/a11y-engine 0.11.43 → 0.11.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -165,6 +165,10 @@ function buildPatternAiInput({ finding, candidate, projectHints }) {
|
|
|
165
165
|
? finding.context.split("\n").map((l) => l.trim()).filter(Boolean)
|
|
166
166
|
: [];
|
|
167
167
|
const matchPrefix = rawMatch.slice(0, 30);
|
|
168
|
+
|
|
169
|
+
// Declare effectiveLineIndex first so it can be used when computing currentAtOriginal.
|
|
170
|
+
let effectiveLineIndex = originalLine !== null ? originalLine - 1 : -1;
|
|
171
|
+
|
|
168
172
|
// The current content at the original line position — use this to pin the anchor
|
|
169
173
|
// to THIS specific element rather than a sibling with a similar match prefix.
|
|
170
174
|
const currentAtOriginal = effectiveLineIndex >= 0
|
|
@@ -186,7 +190,6 @@ function buildPatternAiInput({ finding, candidate, projectHints }) {
|
|
|
186
190
|
// The file may have been modified by a previous sequential fix (lines shifted).
|
|
187
191
|
// Search for the actual current line containing the anchor instead of
|
|
188
192
|
// relying solely on the original line number from the scan.
|
|
189
|
-
let effectiveLineIndex = originalLine !== null ? originalLine - 1 : -1;
|
|
190
193
|
if (anchor && effectiveLineIndex >= 0) {
|
|
191
194
|
const lineAtOriginal = (fileLines[effectiveLineIndex] || "").trim();
|
|
192
195
|
if (!lineAtOriginal.includes(anchor)) {
|