Don't html escape quotes when rendering (#3884)
# What this PR does Disable escaping quotes for html in template results  Alert group 6 shows the new rendering vs group 5 which has the previous incorrect rendering. ## Which issue(s) this PR fixes #3864 ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required)
This commit is contained in:
parent
5329e9dc1a
commit
586a65a094
3 changed files with 9 additions and 3 deletions
|
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
|
||||
- Quotes in templates not rendering results correctly ([#3884](https://github.com/grafana/oncall/pull/3884))
|
||||
|
||||
## v1.3.104 (2024-02-12)
|
||||
|
||||
### Changed
|
||||
|
|
|
|||
|
|
@ -1919,7 +1919,7 @@ def test_alert_group_preview_body_non_existent_template_var(
|
|||
|
||||
# Return errors as preview body instead of None
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.json()["preview"] == "Template Warning: 'foobar' is undefined"
|
||||
assert response.json()["preview"] == "Template Warning: 'foobar' is undefined"
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
|
@ -1942,7 +1942,7 @@ def test_alert_group_preview_body_invalid_template_syntax(
|
|||
|
||||
# Errors now returned preview content
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data["preview"] == "Template Error: No test named 'None' found."
|
||||
assert response.data["preview"] == "Template Error: No test named 'None' found."
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ def clean_markup(text):
|
|||
|
||||
|
||||
def escape_html(text):
|
||||
return html.escape(text)
|
||||
return html.escape(text, quote=False)
|
||||
|
||||
|
||||
def urlize_with_respect_to_a(html):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue