fix code tag and IsPureEnglish
This commit is contained in:
parent
f6eeb79d28
commit
b5486dff72
|
@ -29,7 +29,7 @@ var sourceVisible = localStorage.getItem('source-visible') === 'true';
|
||||||
// ignore example code.
|
// ignore example code.
|
||||||
if (node.classList.contains('code-example') ||
|
if (node.classList.contains('code-example') ||
|
||||||
node.tagName === 'CODE-EXAMPLE' ||
|
node.tagName === 'CODE-EXAMPLE' ||
|
||||||
node.tagName === 'SCRIPT') {
|
node.tagName === 'SCRIPT' || node.tagName === 'CODE') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,8 @@ var sourceVisible = localStorage.getItem('source-visible') === 'true';
|
||||||
|
|
||||||
function isPureEnglish(text) {
|
function isPureEnglish(text) {
|
||||||
if(text){
|
if(text){
|
||||||
return !/\p{Han}/.test(text);
|
text = text.replace('在线例子', '');
|
||||||
|
return /^[\1-\255—’“”ç®…à\u200B]*$/.test(text);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue