User:Evad37/Covery/sandbox.js: Difference between revisions

Content deleted Content added
.
.
Line 85:
 
var getInfoboxTemplate = function getInfoboxTemplate(wikitext) {
var infoboxPattern = /\{\{\s*(.*?[Ii]nfobox.+*?)\s*(\|(?:.|\n)*?(?:(?:\{\{(?:.|\n)*?(?:(?:\{\{(?:.|\n)*?\}\})(?:.|\n)*?)*?\}\})(?:.|\n)*?)*|)\}\}\n?/;
var infoboxParts = infoboxPattern.exec(wikitext);
if (!infoboxParts || !infoboxParts[0] || !infoboxParts[1]) {
Line 1,453:
'{{Infobox vg}}',
'{{Infobox Video Game}}',
'{{Infobox VG}}', /*
'{{IOS App}}',*/,
'{{Infobox video games}}',
'{{Vg infobox}}',
Line 1,480:
let infoboxObject = getInfoboxTemplate(infobox);
assert.throws(function() {
checkedInfobox =return checkInfobox(infoboxObject);
try {
checkedInfobox = checkInfobox(infoboxObject);
} catch (e) {
throw new Error(e);
}
}, infobox + ' throws an error');
});