Make definition anchors more unique

Stick a `definition-` on the front of the autogenerated anchors for definition
blocks.

This solves a problem where, for example,
https://spec.matrix.org/unstable/application-service-api/#registration could
refer to either the "Registration" section or the `Registration` definition
therein.

(These anchors are relatively recent: they were added in #1191.
This commit is contained in:
Richard van der Hoff 2022-11-15 17:06:11 +00:00
parent ac1c5ad2bb
commit b685bcb335

View file

@ -30,7 +30,7 @@
{{ $definition = partial "json-schema/resolve-refs" (dict "schema" $definition "path" $path) }}
{{ $definition = partial "json-schema/resolve-allof" $definition }}
<section class="rendered-data definition" id="{{ anchorize $definition.title }}">
<section class="rendered-data definition" id="definition-{{ anchorize $definition.title }}">
<details {{ if not $compact }}open{{ end }}>
<summary>