Skip to content

Commit

Permalink
Make definition anchors more unique (#1339)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
richvdh committed Nov 15, 2022
1 parent ac1c5ad commit bc15d4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1339.clarification
@@ -0,0 +1 @@
Make definition anchors more unique.
2 changes: 1 addition & 1 deletion layouts/shortcodes/definition.html
Expand Up @@ -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>
Expand Down

0 comments on commit bc15d4f

Please sign in to comment.