summaryrefslogtreecommitdiff
path: root/postgresqleu/util/markup.py
diff options
context:
space:
mode:
authorMagnus Hagander2023-10-16 10:06:48 +0000
committerMagnus Hagander2023-10-16 20:58:54 +0000
commit76525c1d65d1f10f31c70095258cdd5bd4757eec (patch)
tree0b0a332f468e38d54146cf0e4d7489682b442938 /postgresqleu/util/markup.py
parent12933b9bcbe822b8f78304beafed164c5ecb0175 (diff)
Add wrapper class to render linebreaks in backend lists
By wrapping a string in this class, \n will be turned into <br> in the *list*. This is normally not wanted as it can mess with formatting which is why we don't do it by default, but this allows an override of the default behaviour.
Diffstat (limited to 'postgresqleu/util/markup.py')
-rw-r--r--postgresqleu/util/markup.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/postgresqleu/util/markup.py b/postgresqleu/util/markup.py
index ab6012a1..c9616d88 100644
--- a/postgresqleu/util/markup.py
+++ b/postgresqleu/util/markup.py
@@ -5,3 +5,8 @@ import markdown
# as for now anybody entering markdown is considered trusted.
def pgmarkdown(value):
return markdown.markdown(value, extensions=['tables', ])
+
+
+# Wrapper class for a string that we want linebreaks to be visible in
+class LineBreakString(str):
+ pass