Escape asterisks in Slack messages. Fixes #223

This commit is contained in:
Pēteris Caune 2019-02-19 11:11:29 +02:00
parent 63b15d74a5
commit 15a853bd8a
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2
3 changed files with 9 additions and 1 deletions

View File

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

View File

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

View File

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