summaryrefslogtreecommitdiff
path: root/cli/tools/test.rs
diff options
context:
space:
mode:
authorGeert-Jan Zwiers <34610306+GJZwiers@users.noreply.github.com>2021-11-15 15:58:04 +0100
committerGitHub <noreply@github.com>2021-11-15 09:58:04 -0500
commit58e7b290dccbf06abb882daf2ae2b4c1df96f73f (patch)
tree5a404da1b79629758195dd5c3bb103fe30bddaa9 /cli/tools/test.rs
parentdd91ecef502456ba39495d8e178f8101a87c0e34 (diff)
fix(test): support typechecking docs with CRLF line endings (#12748)
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r--cli/tools/test.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs
index fba178202..ab2f801da 100644
--- a/cli/tools/test.rs
+++ b/cli/tools/test.rs
@@ -590,7 +590,7 @@ fn extract_files_from_source_comments(
scope_analysis: false,
})?;
let comments = parsed_source.comments().get_vec();
- let blocks_regex = Regex::new(r"```([^\n]*)\n([\S\s]*?)```")?;
+ let blocks_regex = Regex::new(r"```([^\r\n]*)\r?\n([\S\s]*?)```")?;
let lines_regex = Regex::new(r"(?:\* ?)(?:\# ?)?(.*)")?;
let files = comments
@@ -630,7 +630,7 @@ fn extract_files_from_fenced_blocks(
col: 0,
};
- let blocks_regex = Regex::new(r"```([^\n]*)\n([\S\s]*?)```")?;
+ let blocks_regex = Regex::new(r"```([^\r\n]*)\r?\n([\S\s]*?)```")?;
let lines_regex = Regex::new(r"(?:\# ?)?(.*)")?;
extract_files_from_regex_blocks(