alerta / alerta-webui

Alerta Web UI 7.0
https://try.alerta.io
Apache License 2.0
109 stars 55 forks source link

Rendering HTML in alert attributes #535

Open 2bithacker opened 2 years ago

2bithacker commented 2 years ago

Issue Summary In earlier versions of Alerta, we were able to use HTML to mark up text in custom attributes, however in the most recent alerta-webui, these attributes get displayed without rendering.

Environment

To Reproduce Steps to reproduce the behavior:

  1. send an alert with an attribute containing HTML, such as alerta send -A diff="<pre>diff text</pre>"
  2. Go to web UI and look at the alert
  3. See that the attribute displays "\<pre>diff text\</pre>" rather than rendering diff text in a fixed-width font

For web app issues, include any web browser JavaScript console errors.

Expected behavior The attribute to display diff text in a fixed-width font (due to the <pre> tag.)

This worked in older versions of Alerta, such as 6.5.0.

Additional context I have a PR to submit to address this issue.