Make definition anchors more unique (#1339)

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 19:15:34 +00:00 committed by GitHub
parent ac1c5ad2bb
commit bc15d4f9bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

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>