]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl/tplimpl: Fix title attribute in details shortcode
authorJoe Mooring <joe@mooring.com>
Fri, 13 Dec 2024 18:50:17 +0000 (10:50 -0800)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2024 18:50:17 +0000 (10:50 -0800)
tpl/tplimpl/embedded/templates/shortcodes/details.html
tpl/tplimpl/tplimpl_integration_test.go

index c19d78c3e558bee3fb1159fd976a9932c15be340..82c4f68f78964e396ade81a3c3a0417ffb42fa62 100644 (file)
@@ -68,7 +68,7 @@ Renders an HTML details element.
   {{- with $class }} class="{{ . }}" {{- end }}
   {{- with $name }} name="{{ . }}" {{- end }}
   {{- with $open }} open {{- end }}
-  {{- with $title }} class="{{ . }}" {{- end -}}
+  {{- with $title }} title="{{ . }}" {{- end -}}
 >
   <summary>{{ $summary | .Page.RenderString }}</summary>
   {{ .Inner | .Page.RenderString (dict "display" "block") -}}
index 445316a0a7a361aa8349dc1e6520091cba70f815..1e7aa31113251cee603929950e2a2fc843fc1a52 100644 (file)
@@ -643,7 +643,7 @@ E: An _emphasized_ word.
 
        b.AssertFileContent("public/index.html",
                "<details>\n  <summary>Details</summary>\n  <p>A: An <em>emphasized</em> word.</p>\n</details>",
-               "<details class=\"my-class\" name=\"my-name\" open class=\"my-title\">\n  <summary>A <strong>bold</strong> word</summary>\n  <p>B: An <em>emphasized</em> word.</p>\n</details>",
+               "<details class=\"my-class\" name=\"my-name\" open title=\"my-title\">\n  <summary>A <strong>bold</strong> word</summary>\n  <p>B: An <em>emphasized</em> word.</p>\n</details>",
                "<details>\n  <summary>Details</summary>\n  <p>C: An <em>emphasized</em> word.</p>\n</details>",
                "<details>\n  <summary>Details</summary>\n  <p>D: An <em>emphasized</em> word.</p>\n</details>",
                "<details>\n  <summary>Details</summary>\n  <p>D: An <em>emphasized</em> word.</p>\n</details>",