Bot:Gadget-figureSource.js: Difference between revisions
Content deleted Content added
Prose card tags: chunk section heading instead of the bare chunk number |
Prose heading: walk to the FOLLOWING h6 (marker is a sibling line, not inside it); idempotent tagging |
||
Line 203:
var idx = 0, node;
while (idx < list.length && (node = walker.nextNode())) {
// (staging-copy injection during verification) must never
// nest a second wrapper inside an already-tagged figure
if (node.parentElement.closest(
'table, .fig-card, .fig-banner, .fig-src')) { continue; }
if (chunkOf(node) !== parseInt(chunk, 10)) { break; }
var at, from = 0;
Line 301 ⟶ 305:
} else {
// the chunk's SECTION HEADING, not the bare chunk number —
// "Key highlights", not "chunk 3". The
//
// .ed-chunk), so the heading is a FOLLOWING sibling of the
// marker's block, not an ancestor.
var anchor = document.querySelector(
'span.ed-chunk[id$="-c' + entry.loc.chunk + '"]');
var
}
if (title) { parts.push(title); }
break;
}
}
}
| |||