Skip to content

Commit

Permalink
Use ` instead of " in Go templates to prevent escaping "
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Aug 31, 2018
1 parent 65b9ba2 commit d31eb31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions doc/layouts/_default/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ <h1>{{ .Title }}</h1>
{{ else }}
{{ $secure_icon = "🔐 " }}
{{ end }}
<td>{{ printf "%s<a href=\"%s\"%s>%s</a>" $secure_icon $val.site $data_proofer_ignore_tag ($val.site | replaceRE "^https?://" "" | replaceRE "/$" "") | safeHTML }}</td>
<td>{{ printf "<a href=\"%s\">%s</a>" $org_dir_link ($org_dir | default (or $val.org_src_desc "<em>repo root</em>") | replaceRE "[^<]*/" "") | safeHTML }}</td>
<td>{{ printf `%s<a href="%s"%s>%s</a>` $secure_icon $val.site $data_proofer_ignore_tag ($val.site | replaceRE "^https?://" "" | replaceRE "/$" "") | safeHTML }}</td>
<td>{{ printf `<a href="%s">%s</a>` $org_dir_link ($org_dir | default (or $val.org_src_desc "<em>repo root</em>") | replaceRE "[^<]*/" "") | safeHTML }}</td>
<td>
{{ with $repo_updated_time }}
{{ . | dateFormat "2006/01/02" }}
Expand Down
2 changes: 1 addition & 1 deletion test/site/layouts/_default/headless-bundle-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1 class="post-title">{{ .Title }}</h1>
{{ with $page.Param $key }}
{{ $val := . }}
<p>
{{ printf "<span style=\"font-variant: small-caps;\">%s</span>:" $key | safeHTML }}
{{ printf `<span style="font-variant: small-caps;">%s</span>:` $key | safeHTML }}
{{ with $.Site.GetPage "taxonomyTerm" $key }}
{{ $taxonomy_page := . }}
{{ range $val }}
Expand Down

0 comments on commit d31eb31

Please sign in to comment.