Skip to content

Commit adef36a

Browse files
author
lucifer
committed
feat: 英文版支持复制测试用例
1 parent ec94c2f commit adef36a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/contentScript.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,15 @@ function normalize(testCase) {
6868
}
6969

7070
function extractTestCase(text, prefix) {
71-
const possiblePrefixs = ["输出", "返回", ""];
71+
const possiblePrefixs = [
72+
"输出",
73+
"返回",
74+
"Output",
75+
"output",
76+
"Return",
77+
"return",
78+
"",
79+
];
7280
for (let tag of possiblePrefixs) {
7381
const testCase = text.match(new RegExp(`${prefix}(.*)${tag}`, "s"));
7482
if (testCase && testCase.length > 1) {
@@ -80,7 +88,7 @@ function extractTestCase(text, prefix) {
8088

8189
function getProviedTestCases() {
8290
const possibleTags = ["pre", "p"];
83-
const possiblePrefixs = ["输入:", "输入:"];
91+
const possiblePrefixs = ["输入:", "输入:", "Input:", "input:"];
8492
const ans = [];
8593
for (let tag of possibleTags) {
8694
const pres = document.querySelectorAll(tag);

0 commit comments

Comments
 (0)