A rehype plugin that scopes a message's ids to that message and re-points
everything naming them.
Must run afterrehype-sanitize. Before it, the sanitiser would prefix
the ids again and undo the agreement this restores.
The scope keeps the user-content- convention that carries the
anti-clobbering guarantee — chat content cannot define an id that shadows
one on the host page — and adds the per-message part that makes it unique.
That guarantee now comes from here rather than from the sanitiser's prefix,
which is the trade this fix makes knowingly; test/util/footnoteScope.esm-test.ts
pins it.
A rehype plugin that scopes a message's ids to that message and re-points everything naming them.
Must run after
rehype-sanitize. Before it, the sanitiser would prefix the ids again and undo the agreement this restores.The scope keeps the
user-content-convention that carries the anti-clobbering guarantee — chat content cannot define anidthat shadows one on the host page — and adds the per-message part that makes it unique. That guarantee now comes from here rather than from the sanitiser's prefix, which is the trade this fix makes knowingly;test/util/footnoteScope.esm-test.tspins it.