ma-agents 3.15.4 → 3.15.5
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.
|
@@ -12163,7 +12163,9 @@ function renderDocumentPage(fileRec, manifest, projectRoot, navFlags, resolveAbs
|
|
|
12163
12163
|
const a = node.anchor;
|
|
12164
12164
|
if (!a || existingIds.has(a)) continue;
|
|
12165
12165
|
existingIds.add(a);
|
|
12166
|
-
const
|
|
12166
|
+
const ra = escRe(a);
|
|
12167
|
+
let m = new RegExp('<a\\b[^>]*href="[^"]*#' + ra + '"[^>]*>[^<]*</a>\\s*:', "i").exec(renderedHtml);
|
|
12168
|
+
if (!m) m = new RegExp('<a\\b[^>]*href="[^"]*#' + ra + '"', "i").exec(renderedHtml);
|
|
12167
12169
|
if (m) inlinePlacements.push({ idx: m.index, anchor: a });
|
|
12168
12170
|
else fallbackAnchors.push(a);
|
|
12169
12171
|
}
|
|
@@ -314,8 +314,15 @@ export function renderDocumentPage(
|
|
|
314
314
|
const a = node.anchor;
|
|
315
315
|
if (!a || existingIds.has(a)) continue;
|
|
316
316
|
existingIds.add(a);
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
const ra = escRe(a);
|
|
318
|
+
// Prefer the DEFINITION occurrence — a linkified mention immediately followed
|
|
319
|
+
// by a colon (the BMAD "**FRn:** description" / "## FRn: …" pattern) — over an
|
|
320
|
+
// earlier passing mention. Without this, an FR that a revision-history /
|
|
321
|
+
// changelog row lists near the top of the PRD ("…update FR21, FR91…") anchored
|
|
322
|
+
// there, so clicking the FR jumped to the changelog instead of its definition.
|
|
323
|
+
let m = new RegExp('<a\\b[^>]*href="[^"]*#' + ra + '"[^>]*>[^<]*</a>\\s*:', 'i').exec(renderedHtml);
|
|
324
|
+
// Otherwise fall back to the first linkified mention anywhere on the page.
|
|
325
|
+
if (!m) m = new RegExp('<a\\b[^>]*href="[^"]*#' + ra + '"', 'i').exec(renderedHtml);
|
|
319
326
|
if (m) inlinePlacements.push({ idx: m.index, anchor: a });
|
|
320
327
|
else fallbackAnchors.push(a);
|
|
321
328
|
}
|