Displays description as pre-text, so formatting (i.e. indentation, newlines) is displayed.

This commit is contained in:
Stefan Schallerl 2025-02-13 18:03:13 +01:00
parent b0953a9d66
commit 98fb2948fc
2 changed files with 10 additions and 2 deletions

View file

@ -8,12 +8,20 @@ class TemplateModifiers : Frame.Modifiers, Limbo.Modifiers, DocumentCreateForm.M
FilePreview.Modifiers, DocumentEditForm.Modifiers, FileList.Modifiers,
net.h34t.filemure.tpl.Document.Modifiers, OverviewDocuments.Modifiers, Search.Modifiers, Tags.Modifiers {
private val linebreaks = Regex("\\v+")
fun hashPrefix(arg: String): String {
return URLEncoder.encode(arg, Charsets.UTF_8)
}
override fun starPrefix(arg: String): String {
override fun starPrefix(arg: String) = html(arg)
override fun html(arg: String): String {
return StringEscapeUtils.escapeHtml4(arg)
}
// override fun nl2br(arg: String): String {
// return arg.replace(linebreaks, "<br/>\n")
// }
}

View file

@ -12,7 +12,7 @@
<div class="space"></div>
<b>Description</b>
<div>{*$description}</div>
<pre>{$description|html}</pre>
</fieldset>