mirror of
https://github.com/jbowdre/runtimeterror.git
synced 2024-11-21 14:32:19 +00:00
improve gemini display of li links (esp on about page)
This commit is contained in:
parent
9bb7cf108d
commit
bfa55701d8
1 changed files with 3 additions and 2 deletions
|
@ -21,9 +21,10 @@
|
|||
{{ $content := $content | replaceRE `#\s*\[tl!.*\]` "" -}}
|
||||
{{ $content := $content | replaceRE `<a .*href="(.+?)".*>(.+?)</a>` "[$2]($1)" -}}
|
||||
{{ $content := $content | replaceRE `\sgemini://(\S*)` " [gemini://$1](gemini://$1)" -}}
|
||||
{{ $content := $content | replaceRE `\n\*\s+\[(.+?)\]\((.+?)\)` "\n=> $2 $1" -}}
|
||||
{{/* $content := $content | replaceRE "([^`])<.*?>([^`])" "$1$2" -*/}}
|
||||
{{ $content := $content | replaceRE `\n?\n!\[.*\]\((.+?) \"(.+?)\"\)` "\n\n=> $1 Image: $2" -}}
|
||||
{{ $content := $content | replaceRE `\n?\n!\[.*\]\((.+?)\)` "\n\n=> $1 Embedded Image: $1" -}}
|
||||
{{ $content := $content | replaceRE `\n?\n!\[.*\]\((.+?) \"(.+?)\"\)` "\n=> $1 Image: $2" -}}
|
||||
{{ $content := $content | replaceRE `\n?\n!\[.*\]\((.+?)\)` "\n=> $1 Embedded Image: $1" -}}
|
||||
{{ $links := findRE `\n=> ` $content }}{{ $scratch.Set "ref" (add (len $links) 1) }}
|
||||
{{ $refs := findRE `\[.+?\]\(.+?\)` $content }}
|
||||
{{ $scratch.Set "content" $content }}{{ range $refs }}{{ $ref := $scratch.Get "ref" }}{{ $contentInLoop := $scratch.Get "content" }}{{ $url := (printf "%s #%d" . $ref) }}{{ $contentInLoop := replace $contentInLoop . $url -}}{{ $scratch.Set "content" $contentInLoop }}{{ $scratch.Set "ref" (add $ref 1) }}{{ end }}{{ $content := $scratch.Get "content" | replaceRE `\[(.+?)\]\((.+?)\) #(\d+)` "$1 [$3]" -}}
|
||||
|
|
Loading…
Reference in a new issue