1
Fork 0

Use partial to clean content

This commit is contained in:
Jan-Lukas Else 2020-03-21 00:25:37 +01:00
parent a2c57f3c6a
commit 4bed2db371
2 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,7 @@
{{- else -}} {{- else -}}
"type": "Note", "type": "Note",
{{ end -}} {{ end -}}
"content": {{ ((htmlUnescape .Content | safeHTML) | replaceRE "href=\"/([^\"]*)\"" ( printf "href=\"%s$1\"" ( "" | absURL ) ) ) | jsonify }}, "content": {{ partial "cleanedContent.json" . }},
{{- if .Params.images }} {{- if .Params.images }}
"attachment": [ "attachment": [
{{ $delimiter := "" -}} {{ $delimiter := "" -}}

View File

@ -0,0 +1 @@
{{ (( htmlUnescape .Content | safeHTML ) | replaceRE "href=\"/([^\"]*)\"" ( printf "href=\"%s$1\"" ( "" | absURL ) ) ) | jsonify }}