diff --git a/osclib/comments.py b/osclib/comments.py index c4e1ef35..92c2da73 100644 --- a/osclib/comments.py +++ b/osclib/comments.py @@ -119,14 +119,15 @@ class CommentAPI(object): Usage (in comment): @ [args...] """ - command_re = re.compile(r'^@(?P[^ ]+) (?P.*)$') + command_re = re.compile(r'^@(?P[^ ]+) (?P.*)$', re.MULTILINE) # Search for commands in the order the comment was created. for comment in sorted(comments.values(), key=lambda c: c['when']): if who_allowed and comment['who'] not in who_allowed: continue - match = command_re.search(comment['comment']) + # Handle stupid line endings returned in comments. + match = command_re.search(comment['comment'].replace('\r', '')) if not match: continue