Browse Source

Escape asterisks in Slack messages. Fixes #223

pull/194/head
Pēteris Caune 6 years ago
parent
commit
15a853bd8a
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
3 changed files with 9 additions and 1 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +7
    -0
      hc/front/templatetags/hc_extras.py
  3. +1
    -1
      templates/integrations/slack_message.json

+ 1
- 0
CHANGELOG.md View File

@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
### Bug Fixes ### Bug Fixes
- Fix refreshing of the checks page filtered by tags (#221) - Fix refreshing of the checks page filtered by tags (#221)
- Escape asterisks in Slack messages (#223)
## 1.5.0 - 2019-02-04 ## 1.5.0 - 2019-02-04


+ 7
- 0
hc/front/templatetags/hc_extras.py View File

@ -114,3 +114,10 @@ def break_underscore(s):
s = s.replace("_", "_\u200b") s = s.replace("_", "_\u200b")
return s return s
@register.filter
def fix_asterisks(s):
""" Prepend asterisks with "Combining Grapheme Joiner" characters. """
return s.replace("*", "\u034f*")

+ 1
- 1
templates/integrations/slack_message.json View File

@ -25,7 +25,7 @@
}, },
{% elif check.kind == "cron" %} {% elif check.kind == "cron" %}
{"title": "Schedule", {"title": "Schedule",
"value": "{{ check.schedule|escapejs }}",
"value": "{{ check.schedule|fix_asterisks|escapejs }}",
"short": true "short": true
}, },
{% endif %} {% endif %}


Loading…
Cancel
Save