mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-29 15:34:09 +02:00
Fix changed-in partial when used with multiple paragraphs
When used with a text that includes multiple paragraphs, the partial created invalid HTML by nesting `<p>` elements. It also changed the rendering by making "Changed in vX.XX:" a separate paragraph, when it is inline with a single paragraph. To change that we do as with "Required" and add "Changed in vX.XX:" to the text before it is rendered, making it inline with the first paragraph. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
parent
c5d7eb7a2d
commit
2ecebb1ae8
|
|
@ -1,15 +1,11 @@
|
||||||
{{/*
|
{{- /*
|
||||||
Renders the "Changed in [version]:" blocks for x-changedInMatrixVersion
|
Renders the "Changed in [version]:" blocks for x-changedInMatrixVersion
|
||||||
annotations for openapi parameters
|
annotations for openapi parameters
|
||||||
|
|
||||||
Takes a single 'changes_dict' parameter, which should be a map of
|
Takes a single 'changes_dict' parameter, which should be a map of
|
||||||
version -> details pairs.
|
version -> details pairs.
|
||||||
*/ -}}
|
*/ -}}
|
||||||
{{ range $ver, $details := .changes_dict -}}
|
{{- range $ver, $details := .changes_dict -}}
|
||||||
<p>
|
{{- $details = printf "**Changed in `v%s`:** %s" $ver (default "" $details) -}}
|
||||||
<strong>
|
{{- $details | page.RenderString (dict "display" "block") -}}
|
||||||
Changed in <code>v{{ $ver }}</code>:
|
|
||||||
</strong>
|
|
||||||
{{ $details | markdownify }}
|
|
||||||
</p>
|
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue