I’m seeing some unexpected behavior with custom output formats.
I have two custom formats that are nearly identical, but behave differently:
[ outputFormats.plain ]
name = "plain"
isPlainText = true
isHTML = false
mediaType = "text/plain"
permalinkable = true
path = "txt/"
[ outputFormats.gemini ]
name = "GEMINI"
isPlainText = true
isHTML = false
mediaType = "text/gemini"
protocol = "gemini://"
permalinkable = true
path = "gemini/"
The plain
output converts single and double quotes to their corresponding HTML entities, while the gemini
output does not. Even when both use a copy of the same template:
# {{ .Title }}
{{ $content := .RawContent -}}
{{ $content := $content | replaceRE "`(.+?)`" "$1" -}}
{{ $content := $content | replaceRE "`" "```" -}}
{{ $content := $content | replaceRE "\\*(.+?)\\*" "$1" -}}
{{ $content := $content | replaceRE " \\[(.+?)\\]\\((.+?)\\)" "\n\n=> $2 $1\n\n" -}}
{{ $content := $content | replaceRE "\\[(.+?)\\]\\((.+?)\\)" "=> $2 $1" -}}
{{ $content := $content | replaceRE "<!--more-->" "" -}}
{{ $content }}
hugo v0.89.4+extended linux/amd64