From 848ecbcdf2ae15a6b74bb348385709098f2c700a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 22 Jul 2020 01:22:44 +0200 Subject: Suggestion.suggestion: Handle "\r\n" Update the regex matcher to allow both LF line endings and CRLF. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 6811a1e..6db5c67 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -86,7 +86,7 @@ impl Suggestion { } fn suggestion(&self) -> String { - let re = Regex::new(r"(?s).*```\s*suggestion\n").unwrap(); + let re = Regex::new(r"(?s).*(?-s)```\s*suggestion.*\n").unwrap(); let s = re.replace(&self.suggestion, "+"); s.replace("```", "") } -- cgit v1.2.3