From 2ecebb1ae8bfd82ab14f510bc63459e29398165a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 19 Nov 2024 12:01:14 +0100 Subject: [PATCH] Fix changed-in partial when used with multiple paragraphs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When used with a text that includes multiple paragraphs, the partial created invalid HTML by nesting `

` 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 --- layouts/partials/changed-in.html | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/layouts/partials/changed-in.html b/layouts/partials/changed-in.html index 61aba5b1..7aa190a4 100644 --- a/layouts/partials/changed-in.html +++ b/layouts/partials/changed-in.html @@ -1,15 +1,11 @@ -{{/* +{{- /* Renders the "Changed in [version]:" blocks for x-changedInMatrixVersion annotations for openapi parameters Takes a single 'changes_dict' parameter, which should be a map of version -> details pairs. */ -}} -{{ range $ver, $details := .changes_dict -}} -

- - Changed in v{{ $ver }}: - - {{ $details | markdownify }} -

+{{- range $ver, $details := .changes_dict -}} + {{- $details = printf "**Changed in `v%s`:** %s" $ver (default "" $details) -}} + {{- $details | page.RenderString (dict "display" "block") -}} {{ end -}}