From 4bba186b81146eb1791f56e3d1fbae2bf3e476ce Mon Sep 17 00:00:00 2001 From: mtail Date: Tue, 10 Jul 2018 12:15:21 -0700 Subject: [PATCH] Special case empty @@ in code blocks to be NOPs. --- layouts/shortcodes/text.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/text.html b/layouts/shortcodes/text.html index e8e6412750..40f2368244 100644 --- a/layouts/shortcodes/text.html +++ b/layouts/shortcodes/text.html @@ -52,6 +52,9 @@ be invalid HTML {{ $branch := .Site.Data.args.branch_name }} {{ $links := findRE "@(.*?)@" ($scratch.Get "text") }} {{ range $link := $links }} -{{ $href := printf "https://raw.githubusercontent.com/istio/istio/%s/%s" $branch (trim $link "@") }} +{{ $target := trim $link "@" }} +{{ if gt (len $target) 0 }} +{{ $href := printf "https://raw.githubusercontent.com/istio/istio/%s/%s" $branch $target }} {{ end }} +{{ end }}