mirror of https://github.com/grpc/grpc.io.git
Support markdown in link text (#251)
- Add back the `safeURL` transform. - Add `rel="noopener"` for external links. - Followup to #247, which removed the `safeURL` transformation.
This commit is contained in:
parent
3a008dc431
commit
cb715ab559
|
|
@ -1,2 +1,10 @@
|
|||
{{ $isRemote := hasPrefix .Destination "http" }}
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if $isRemote }} target="_blank"{{ end }}>{{- .Text -}}{{ if $isRemote }} <sup><i class="fas fa-external-link-alt"></i></sup>{{ end }}</a>
|
||||
{{ $isRemote := hasPrefix .Destination "http" -}}
|
||||
<a href="{{ .Destination | safeURL }}"
|
||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||
{{- if $isRemote }} target="_blank" rel="noopener"{{ end -}}
|
||||
>
|
||||
{{- .Text | safeHTML -}}
|
||||
{{ if $isRemote -}}
|
||||
<sup><i class="fas fa-external-link-alt"></i></sup>
|
||||
{{- end -}}
|
||||
</a>
|
||||
Loading…
Reference in New Issue