aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2020-07-22 01:22:44 +0200
committerTeddy Wing2020-07-22 01:22:44 +0200
commit848ecbcdf2ae15a6b74bb348385709098f2c700a (patch)
tree20ab24477f5f84429fed20b55f0c81ef98e398cb
parent7f60ab275bce53ebc3d770fbda7439c4c4d7c8c6 (diff)
downloadgit-suggestion-848ecbcdf2ae15a6b74bb348385709098f2c700a.tar.bz2
Suggestion.suggestion: Handle "\r\n"
Update the regex matcher to allow both LF line endings and CRLF.
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
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("```", "")
}