diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 0288029da..f37614f07 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,4 +1,5 @@ {{$trimmed := strings.TrimSuffix ".md" (.Destination | safeURL)}} +{{$trimmed = replace $trimmed "%20" "-"}} {{$external := strings.HasPrefix $trimmed "http" }} {{ if $external }} {{ .Text | safeHTML }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 9193ee629..9f6443d1a 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,6 +1,3 @@ -{{$content := replaceRE `a href="\.\.\/(.+%20.+)+"` `$1` .Content}} -{{$content = replace $content "%20" "-"}} -{{$content = $content | safeHTML}} {{ partial "head.html" . }} @@ -22,7 +19,7 @@ {{ .TableOfContents }} {{end}} - {{- $content -}} + {{.Content}} {{partial "footer.html" .}} diff --git a/layouts/index.html b/layouts/index.html index 6f7725bf5..6496b6fe7 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,6 +1,3 @@ -{{$content := replaceRE `a href="\.\.\/(.+%20.+)+"` `$1` .Content}} -{{$content = replace $content "%20" "-"}} -{{$content = $content | safeHTML}} {{ partial "head.html" . }} @@ -22,7 +19,7 @@ {{ .TableOfContents }} {{end}} - {{- $content -}} + {{- .Content -}} {{partial "footer.html" .}} diff --git a/layouts/partials/backlinks.html b/layouts/partials/backlinks.html index 16b96cdf1..744f7e369 100644 --- a/layouts/partials/backlinks.html +++ b/layouts/partials/backlinks.html @@ -10,7 +10,7 @@ {{$src = replace $src " " "-"}}
  • - {{index . "source"}} + {{index . "source"}}
  • {{- end -}} {{else}} diff --git a/layouts/partials/graph.html b/layouts/partials/graph.html index d10c7f5e2..d529e8d8e 100644 --- a/layouts/partials/graph.html +++ b/layouts/partials/graph.html @@ -184,7 +184,7 @@ const labels = graphNode.append("text") .attr("dx", 12) .attr("dy", ".35em") - .text((d) => d.id.replace("%20", " ")) + .text((d) => encodeURI(d.id)) .style("opacity", 0) .style("pointer-events", "none") .call(drag(simulation));