mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-16 12:54:42 -04:00
Handle corner case with rendering text as code in URL
Without `| safeHTML` for `[`hrefTargetBlank`](http://example.com/hugo-docs) doesn't work` links text it is rendered verbatimly as `<code>hrefTargetBlank</code>`. After my change it would use default styling for code.
This commit is contained in:
parent
3cb4b19dde
commit
6925cda306
@ -134,7 +134,7 @@ PlainText
|
||||
Here is a code example for how the render-link.html template could look:
|
||||
|
||||
{{< code file="layouts/_default/_markup/render-link.html" >}}
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text }}</a>
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text | safeHTML }}</a>
|
||||
{{< /code >}}
|
||||
|
||||
#### Image Markdown example:
|
||||
|
Loading…
x
Reference in New Issue
Block a user