add inline attributes to render heading template #135

This commit is contained in:
Dmitry Kolosov 2022-01-24 21:25:12 +03:00
parent 47a0734cce
commit 2f24c40515

View File

@ -1,7 +1,7 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ if .Attributes.style }}style="{{ .Attributes.style | safeCSS }}"{{ end }}>{{ .Text | safeHTML }}
<span>
<a href="#{{ .Anchor }}">
<svg viewBox="0 0 28 23" height="100%" width="19 " xmlns="http://www.w3.org/2000/svg"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/></svg>
<svg viewBox="0 0 28 23" height="100%" width="19" xmlns="http://www.w3.org/2000/svg"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/></svg>
</a>
</span>
</h{{ .Level }}>