remove unnecessary regex, use encodeuri for label instead of replace
This commit is contained in:
parent
a14d06aa3d
commit
9292de6333
@ -1,4 +1,5 @@
|
|||||||
{{$trimmed := strings.TrimSuffix ".md" (.Destination | safeURL)}}
|
{{$trimmed := strings.TrimSuffix ".md" (.Destination | safeURL)}}
|
||||||
|
{{$trimmed = replace $trimmed "%20" "-"}}
|
||||||
{{$external := strings.HasPrefix $trimmed "http" }}
|
{{$external := strings.HasPrefix $trimmed "http" }}
|
||||||
{{ if $external }}
|
{{ if $external }}
|
||||||
<a href="{{ $trimmed }}" rel="noopener">{{ .Text | safeHTML }}</a>
|
<a href="{{ $trimmed }}" rel="noopener">{{ .Text | safeHTML }}</a>
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
{{$content := replaceRE `a href="\.\.\/(.+%20.+)+"` `$1` .Content}}
|
|
||||||
{{$content = replace $content "%20" "-"}}
|
|
||||||
{{$content = $content | safeHTML}}
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
{{ partial "head.html" . }}
|
{{ partial "head.html" . }}
|
||||||
@ -22,7 +19,7 @@
|
|||||||
{{ .TableOfContents }}
|
{{ .TableOfContents }}
|
||||||
</aside>
|
</aside>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{- $content -}}
|
{{.Content}}
|
||||||
</article>
|
</article>
|
||||||
{{partial "footer.html" .}}
|
{{partial "footer.html" .}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
{{$content := replaceRE `a href="\.\.\/(.+%20.+)+"` `$1` .Content}}
|
|
||||||
{{$content = replace $content "%20" "-"}}
|
|
||||||
{{$content = $content | safeHTML}}
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
{{ partial "head.html" . }}
|
{{ partial "head.html" . }}
|
||||||
@ -22,7 +19,7 @@
|
|||||||
{{ .TableOfContents }}
|
{{ .TableOfContents }}
|
||||||
</aside>
|
</aside>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{- $content -}}
|
{{- .Content -}}
|
||||||
</article>
|
</article>
|
||||||
{{partial "footer.html" .}}
|
{{partial "footer.html" .}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
{{$src = replace $src " " "-"}}
|
{{$src = replace $src " " "-"}}
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="{{$src | safeHTML}}">{{index . "source"}}</a>
|
<a href="{{$src}}">{{index . "source"}}</a>
|
||||||
</li>
|
</li>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -184,7 +184,7 @@
|
|||||||
const labels = graphNode.append("text")
|
const labels = graphNode.append("text")
|
||||||
.attr("dx", 12)
|
.attr("dx", 12)
|
||||||
.attr("dy", ".35em")
|
.attr("dy", ".35em")
|
||||||
.text((d) => d.id.replace("%20", " "))
|
.text((d) => encodeURI(d.id))
|
||||||
.style("opacity", 0)
|
.style("opacity", 0)
|
||||||
.style("pointer-events", "none")
|
.style("pointer-events", "none")
|
||||||
.call(drag(simulation));
|
.call(drag(simulation));
|
||||||
|
Loading…
Reference in New Issue
Block a user