diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e5ee2c7..27f5060c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add filter descriptions to web ui by @iskhakov ([1845](https://github.com/grafana/oncall/pull/1845)) +### Fixed + +- Fix bugs in web title and message templates rendering and visual representation ([1747](https://github.com/grafana/oncall/pull/1747)) + ## v1.2.16 (2023-04-27) ### Added diff --git a/engine/apps/alerts/tests/test_default_templates.py b/engine/apps/alerts/tests/test_default_templates.py index 50c1ecd6..eda1bcf3 100644 --- a/engine/apps/alerts/tests/test_default_templates.py +++ b/engine/apps/alerts/tests/test_default_templates.py @@ -63,6 +63,10 @@ def test_default_templates( ) rendered_attr = getattr(rendered_alert, attr) + print(f"{alert_receive_channel}'s {notification_channel} {attr} ") + print(rendered_attr) + print() + print("====================================") assert rendered_attr == expected, ( f"{alert_receive_channel}'s {notification_channel} {attr} " f"is not equal to expected" ) diff --git a/engine/common/utils.py b/engine/common/utils.py index 7c3ab5c0..4f69df3f 100644 --- a/engine/common/utils.py +++ b/engine/common/utils.py @@ -168,13 +168,14 @@ def convert_md_to_html(text): # This gives us
 and  tags for ```-fenced blocks
             "fenced-code-blocks",
             "pyshell",
+            "nl2br",
+            "target-blank-links",
+            "nofollow",
+            "pymdownx.emoji",
+            "pymdownx.magiclink",
+            "tables",
         ],
     ).strip()
-    # Special handling cases for lists
-    text = text.replace("\n\n