Pass style as shortcode arg

This looks like a Go bug, which I assume will be fixed, but I would love a workaround:

The above is similar to passing some style as a shortcode parameter, and then do:

<section style="{{ .Get "style" | safeHTMLAttr }}">
</section>

The output is something like:

<section style="ZgotmplZ">

I assume I can do a “printf” of the complete “section” HTML entity …

OK, so a hack like this works:

{{ $s := printf "<section class=\"%s\" style=\"%s\">" $class $style }}
1 Like

Maybe safeCSS instead?

2 Likes

You are right!

1 Like