aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Vo <auscompgeek@users.noreply.github.com>2018-04-24 23:40:18 +1000
committerTrygve Aaberge <trygveaa@gmail.com>2019-01-25 23:45:04 +0100
commitf2770cf16e0948e08521c881d811574261f50a51 (patch)
tree7790dd5a832b70e9ac7d82353bad219c935874a2
parent13d299a1276efac721d0009b4be1e5e557477430 (diff)
downloadwee-slack-f2770cf16e0948e08521c881d811574261f50a51.tar.gz
Fix bold/italics matching across newlines
-rw-r--r--wee_slack.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 96932d3..2b0fc3d 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2851,11 +2851,11 @@ def process_emoji_changed(message_json, eventrouter, **kwargs):
###### New module/global methods
def render_formatting(text):
- text = re.sub(r'(^| )\*([^*]+)\*([^a-zA-Z0-9_]|$)',
+ text = re.sub(r'(^| )\*([^*\n]+)\*([^a-zA-Z0-9_]|$)',
r'\1{}\2{}\3'.format(w.color(config.render_bold_as),
w.color('-' + config.render_bold_as)),
text)
- text = re.sub(r'(^| )_([^_]+)_([^a-zA-Z0-9_]|$)',
+ text = re.sub(r'(^| )_([^_\n]+)_([^a-zA-Z0-9_]|$)',
r'\1{}\2{}\3'.format(w.color(config.render_italic_as),
w.color('-' + config.render_italic_as)),
text)