Fixed pre-line issue in chrome

This commit is contained in:
Asaf Gartner 2022-08-07 01:04:45 +03:00
parent b995df4533
commit 4c1daae5e1
2 changed files with 5 additions and 2 deletions

View File

@ -37,8 +37,8 @@
{{/* content */}}
{{ if .Description }}
<div class="mt3 overflow-hidden relative pre-line {{ if .TruncateDescription }}mh-5{{ end }}">
<div class="post-content">{{ .Description }}</div>
<div class="mt3 overflow-hidden relative {{ if .TruncateDescription }}mh-5{{ end }}">
<div class="post-content pre-line">{{ trim .Description }}</div>
{{ if .TruncateDescription }}
<div class="excerpt-fade absolute w-100 h4 bottom-0 z-999"></div>
{{ end }}

View File

@ -226,6 +226,9 @@ var HMNTemplateFuncs = template.FuncMap{
"cleancontrolchars": func(str template.HTML) template.HTML {
return template.HTML(controlCharRegex.ReplaceAllString(string(str), ""))
},
"trim": func(str template.HTML) template.HTML {
return template.HTML(strings.TrimSpace(string(str)))
},
// NOTE(asaf): Template specific functions:
"projectcarddata": func(project Project, classes string) ProjectCardData {