Потребител:Ted Masters/Test.js: Разлика между версии

Изтрито е съдържание Добавено е съдържание
Редакция без резюме
Редакция без резюме
(Не са показани 3 междинни версии от същия потребител)
Ред 24:
ct.doNotFix = function (s, m, checkPat1, checkPat2, checkTags, checkFileName) {
var pos = m.start;
var pat = /\[\[[^|\]]*$|\{\{[^|}]*$|[:\/%][^\s|>]+$|<[^>]*$|#\w*expr:.*$/i;
if (checkPat1 !== false && s.substring(pos - 260, pos + 1).search(pat) >= 0)
return true; // it's a link, so don't change it
 
if (checkPat2 !== false) {
var pat2 = /\{\{\s*(друг[ои] значени[ея]|основна|main|към|от пренасочване|категория|anchor|cite|citation|цитат2?|quote|is[sb]n|lang[i2]?|sfn|hrf|harv)\b((?!\{\{|\}\})[^\s\S]|\{\{(?:(?!\{\{|\}\})[\s\S]|\{\{(?:(?!\{\{|\}\})[\s\S]|\{\{(?:(?!\{\{|\}\})[\s\S])*$\}\})*\}\})*\}\})*\}\}/igi;
if (checkPat2 !== false && s.substring(pos - 260, pos + 1).search(pat2) >= 0)
var match;
return true; // likely templates with page-name
while ((match = pat2.exec(s)) !== null) {
if (pos > match.index && pos < (match.index + match[0].length)) {
return true;
}
}
} // skip specific templates with up to 3 levels of template nesting
 
if (checkTags !== false) {
var nextTagPos = s.slice(pos).search(/<\/?(chem|math|pre|code|tt|source|syntaxhighlight|timeline|graph|mapframe|maplink|poem|blockquote|q|i|ref)\b/i);
if (nextTagPos >= 0 && s.charAt(pos + nextTagPos + 1) == '/')
return true; // don't break askip math/chem equations, source code, timelines/, graphs, maps, ref content, content in citation tags
}
 
if (checkFileName !== false && s.slice(pos).search(/^[^|{}[\]<>\n]*\.([a-z]{3,4}\s*([|}\n]|\{\{!\}))/i) >= 0)
return true; // it's a file name parameter
};