You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2023/03/26 17:01:01 UTC

[comdev-site] branch master updated: Handle optional attributes

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/comdev-site.git


The following commit(s) were added to refs/heads/master by this push:
     new c0a80e1  Handle optional attributes
c0a80e1 is described below

commit c0a80e18902e1e689b46df8602ada82488c1fc7a
Author: Sebb <se...@apache.org>
AuthorDate: Sun Mar 26 18:00:53 2023 +0100

    Handle optional attributes
---
 layouts/_default/_markup/render-heading.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html
index 6e02d60..485bb88 100644
--- a/layouts/_default/_markup/render-heading.html
+++ b/layouts/_default/_markup/render-heading.html
@@ -1,4 +1,4 @@
-<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
+<h{{ .Level }}{{- range $k, $v := .Attributes -}}{{- printf " %s=%q" $k $v | safeHTMLAttr -}}{{- end }}>{{- .Text | safeHTML -}}
 {{- if and (ge .Level 1) (le .Level 4) }}{{" " -}}
 <a class="headerlink" title="Permalink" href="#{{ .Anchor | safeURL }}">&para;</a>
 {{- end -}}