MediaWiki:Gadget-Pikan-pikipedia.js: Difference between revisions

m
Porplemontage moved page MediaWiki:Pikan-pikipedia.js to MediaWiki:Gadget-Pikan-pikipedia.js without leaving a redirect
(Created page with "//<nowiki> pikan.wiki_url = "http://pikminwiki.com/"; pikan.types["Problem"] = { color: "#600", background: "rgba(255, 128, 128, 0.8)", description: "General Me...")
 
m (Porplemontage moved page MediaWiki:Pikan-pikipedia.js to MediaWiki:Gadget-Pikan-pikipedia.js without leaving a redirect)
 
(35 intermediate revisions by 2 users not shown)
Line 1: Line 1:
//<nowiki>
//<nowiki>


pikan.wiki_url = "http://pikminwiki.com/";
function init_pikan() {
 
 
pikan.wiki_url = "https://www.pikminwiki.com/";
pikan.help_link = "https://www.pikminwiki.com/User:Espyo/Pikan";
pikan.module_name = "Pikipedia";
pikan.module_version = "1.11.0";


pikan.types["Problem"] = {
pikan.types["Problem"] = {
Line 48: Line 54:
    
    
   //Find sub-optimal names for the Smash 4 games.
   //Find sub-optimal names for the Smash 4 games.
   reg = /(Super Smash Bros\.? for Wii U and 3DS|Super Smash Bros\.? for 3DS & Wii U|Super Smash Bros\.? for Wii U & 3DS|Super Smash Bros. 4)/igm;
   reg = /(Super Smash Bros\.? for Wii U and 3DS|Super Smash Bros\.? for (Nintendo )?3DS & Wii U|Super Smash Bros\.? for Wii U & (Nintendo )?3DS|Super Smash Bros. 4)/igm;
   pikan.regex_check(reg, "Problem", "Sub-optimal name for the Smash game found. For consistency's sake, you should only use these names: \"Super Smash Bros. for 3DS and Wii U\", \"Super Smash Bros. for 3DS\", \"Super Smash Bros. for Wii U\".");
   pikan.regex_check(reg, "Problem", "Sub-optimal name for the Smash game found. For consistency's sake, you should only use these names: \"Super Smash Bros. for Nintendo 3DS and Wii U\", \"Super Smash Bros. for Nintendo 3DS\", \"Super Smash Bros. for Wii U\".");
    
    
    
    
   //Find bad names for the inhabitants of Hocotate/Koppai.
   //Find bad names for the inhabitants of Hocotate/Koppai.
   reg = /(Hocotaitt?e|Kopp?aitt?i9an|Kopaitt?e|Kopp?aii?an)/igm;
   reg = /(Hocotaitt?e|Kopp?aitt?i?an|Kopaitt?e|Kopp?aii?an)/igm;
   pikan.regex_check(reg, "Problem", "Bad inhabitant term found. Characters from Hocotate are \"Hocotatian(s)\", and those from Koppai are \"Koppaite(s)\".", "Category:Places");
   pikan.regex_check(reg, "Problem", "Bad inhabitant term found. Characters from Hocotate are \"Hocotatian(s)\", and those from Koppai are \"Koppaite(s)\".", "Category:Places");
 
 
  //Find bad names for Shepherd.
  reg = /(Shepp?h?ard|Shepph?erd|Sheperd)/igm;
  pikan.regex_check(reg, "Problem", "Bad name for Shepherd found.", "Shepherd");
    
    
    
    
Line 60: Line 71:
   reg = /^\[\[File\:.+\|thumb.*\]\]/igm;
   reg = /^\[\[File\:.+\|thumb.*\]\]/igm;
   pikan.regex_check(
   pikan.regex_check(
     reg, "Policy", "Image thumbs must have a caption, and it must end with a period.", "Pikipedia:Policy#Frames_and_galleries",
     reg, "Policy", "Image thumbs must have a caption, and it must end with a period.", "Pikipedia:General_content_guidelines#Frames_and_galleries",
     function(r){
     function(r){
       if(r[0][r[0].length - 3] != ".") return true;
       if(r[0][r[0].length - 3] != ".") return true;
Line 71: Line 82:
   reg = /^.+$/igm;
   reg = /^.+$/igm;
   pikan.regex_check(
   pikan.regex_check(
     reg, "Policy", "Images in galleries must have a caption, and it must end in a period.", "Pikipedia:Policy#Frames_and_galleries",
     reg, "Policy", "Images in galleries must have a caption, and it must end in a period.", "Pikipedia:General_content_guidelines#Frames_and_galleries",
     function(r){
     function(r){
       if(!pikan.in_area(r, "<gallery>", "</gallery>")) return false;
       if(!pikan.in_area(r, "<gallery", "</gallery>")) return false;
       var slash_pos = r[0].indexOf("|");
       var slash_pos = r[0].indexOf("|");
       if(slash_pos == -1 || slash_pos == r[0].length - 1) return true;
       if(slash_pos == -1 || slash_pos == r[0].length - 1) return true;
Line 83: Line 94:
    
    
   //Find game names without italicization.
   //Find game names without italicization.
   reg = /(New Play Control! Pikmin 2|New Play Control! Pikmin|Pikmin 2|Pikmin 3|Pikmin Adventure|Nintendo Land|New Play Control!|Super Smash Bros\. for 3DS and Wii U|Super Smash Bros\. (Melee|Brawl))/igm;
   reg = /(New Play Control! Pikmin 2|New Play Control! Pikmin|Pikmin 2|Pikmin 3 Deluxe|Pikmin 3|Pikmin 4|Hey! Pikmin|Pikmin Bloom|Pikmin Adventure|Nintendo Land|New Play Control!|Super Smash Bros\. for Nintendo 3DS and Wii U|Super Smash Bros\. (Melee|Brawl|Ultimate))/igm;
   pikan.regex_check(
   pikan.regex_check(
     reg, "Policy", "Game names should be in italics.", "Pikipedia:Policy#Italicizing",
     reg, "Policy", "Game names should be in italics.", "Pikipedia:General_content_guidelines#Italicizing",
     function(r){
     function(r){
       if(pikan.is_common_exception(r)) return false;
       if(pikan.is_common_exception(r)) return false;
Line 110: Line 121:
   reg = /Pikmin 1/igm;
   reg = /Pikmin 1/igm;
   pikan.regex_check(
   pikan.regex_check(
     reg, "Policy", "\"Pikmin 1\" found; that's not what the first game is called, so change it to Pikmin.", "Pikipedia:Policy#.22Pikmin_1.22",
     reg, "Policy", "\"Pikmin 1\" found; that's not what the first game is called, so change it to Pikmin.", "Pikipedia:General_content_guidelines#.22Pikmin_1.22",
     function(r){
     function(r){
       return !pikan.is_common_exception(r);
       return !pikan.is_common_exception(r);
Line 120: Line 131:
   reg = /\[\[Pikmin 1(\||\]\])/igm;
   reg = /\[\[Pikmin 1(\||\]\])/igm;
   pikan.regex_check(
   pikan.regex_check(
     reg, "Policy", "\"Pikmin 1\" found; that's not what the first game is called, so link the page to \"Pikmin (game)\".", "Pikipedia:Policy#.22Pikmin_1.22");
     reg, "Policy", "\"Pikmin 1\" found; that's not what the first game is called, so link the page to \"Pikmin (game)\".", "Pikipedia:General_content_guidelines#.22Pikmin_1.22");
 
 
  //Find "Hey Pikmin" in text.
  reg = /Hey Pikmin/igm;
  pikan.regex_check(
    reg, "Policy", "\"Hey Pikmin\" found; don't forget to add the exclamation mark (!) after the \"Hey\".",
    function(r){
      return !pikan.is_common_exception(r);
    }
  );
    
    
    
    
   //Find "Pikmins".
   //Find "Pikmins".
   reg = /pikmins/igm;
   reg = /pikmins/igm;
   pikan.regex_check(reg, "Policy", "\"Pikmins\" found. The plural of \"Pikmin\" is \"Pikmin\".", "Pikmin_family#Name",
   pikan.regex_check(reg, "Policy", "\"Pikmins\" found. The plural of \"Pikmin\" is \"Pikmin\".", "Pikmin_family#Naming",
     function(r){
     function(r){
       return !pikan.is_common_exception(r);
       return !pikan.is_common_exception(r);
Line 135: Line 156:
   reg = /pikmin/gm;
   reg = /pikmin/gm;
   pikan.regex_check(
   pikan.regex_check(
     reg, "Policy", "\"pikmin\" with lowercase 'p' found. The official spelling is always with an uppercase 'P'.", "Pikipedia:Policy#Capitalization",
     reg, "Policy", "\"pikmin\" with lowercase 'p' found. The official spelling is always with an uppercase 'P'.", "Pikipedia:General_content_guidelines#Capitalization",
     function(r){
     function(r){
       return !pikan.is_common_exception(r);
       return !pikan.is_common_exception(r);
Line 145: Line 166:
   reg = /(red|yellow|blue|purple|white|rock|winged) Pikmin/gm;
   reg = /(red|yellow|blue|purple|white|rock|winged) Pikmin/gm;
   pikan.regex_check(
   pikan.regex_check(
     reg, "Policy", "Lowercase Pikmin name found. Pikmin type names should start in uppercase.", "Pikipedia:Policy#Capitalization",
     reg, "Policy", "Lowercase Pikmin name found. Pikmin type names should start in uppercase.", "Pikipedia:General_content_guidelines#Capitalization",
     function(r){
     function(r){
       return !pikan.is_common_exception(r);
       return !pikan.is_common_exception(r);
Line 154: Line 175:
   //Find lowercase "Onion".
   //Find lowercase "Onion".
   reg = /onion/gm;
   reg = /onion/gm;
   pikan.regex_check(reg, "Policy", "\"onion\" with a lowercase 'o' found. The official spelling is with an uppercase 'O'.", "Pikipedia:Policy#Capitalization",
   pikan.regex_check(reg, "Policy", "\"onion\" with a lowercase 'o' found. The official spelling is with an uppercase 'O', unless you're talking about the real-world food.", "Pikipedia:General_content_guidelines#Capitalization",
    function(r){
      return !pikan.is_common_exception(r);
    }
  );
 
 
  //Find lowercase "Poko".
  reg = /poko/gm;
  pikan.regex_check(reg, "Policy", "\"poko\" with a lowercase 'p' found. The official spelling is with an uppercase 'P'.", "Pikipedia:General_content_guidelines#Capitalization",
     function(r){
     function(r){
       return !pikan.is_common_exception(r);
       return !pikan.is_common_exception(r);
Line 162: Line 192:
    
    
   //Find words that start in uppercase needlessly.
   //Find words that start in uppercase needlessly.
   reg = /\b(Area|Bitter|Bomb-?[Rr]ock|Bomb [Rr]ock|Boulder|Bridge|Cardboard [Bb]ox|Cave|Climbing [Ss]tick|Clipboard|Clog|Crystal|Day|Dirt [Mm]ound|Egg|Electrode|Elevator [Pp]latform|Enemy|Fire [Gg]eyser|Fragment|Gate|Leader|Nectar|Paper [Bb]ag|Reel|Spicy|Spray|Sublevel|Ultra|Wall)\b/gm;
   reg = /\b(Area|Bitter|Bomb-?[Rr]ock|Bomb|Boulder|Bridge|Cardboard [Bb]ox|Cave|Climbing [Ss]tick|Clipboard|Clog|Crystal|Day|Dirt [Mm]ound|Egg|Electrode|Elevator [Pp]latform|Enemy|Fire [Gg]eyser|Fragment|Gate|Leader|Nectar|Nugget|Paper [Bb]ag|Reel|Spicy|Spray|Sublevel|Ultra|Wall|Leafling)\b/gm;
   pikan.regex_check(
   pikan.regex_check(
     reg, "Policy",
     reg, "Policy",
     "Common word starting in uppercase found. This word should likely start in lowercase, as there is no reason for it to start with a capital mid-sentence. Check the surrounding words, too.",
     "Common word starting in uppercase found. This word should likely start in lowercase, as there is no reason for it to start with a capital mid-sentence. Check the surrounding words, too.",
     "Pikipedia:Policy#Capitalization",
     "Pikipedia:General_content_guidelines#Capitalization",
     function(r){
     function(r){
       if((pikan.must_be_upper(r))) return false;
       if((pikan.must_be_upper(r))) return false;
Line 177: Line 207:
   //Find "NTSC" and "PAL".
   //Find "NTSC" and "PAL".
   reg = /\b(NTSC|PAL)\b/igm;
   reg = /\b(NTSC|PAL)\b/igm;
   pikan.regex_check(reg, "Policy", "\"NTSC\" or \"PAL\" found. Try \"US\" or \"Europe\" instead.", "Pikipedia:Policy#Region",
   pikan.regex_check(reg, "Policy", "\"NTSC\" or \"PAL\" found. Try \"US\" or \"Europe\" instead.", "Pikipedia:General_content_guidelines#Region",
     function(r){
     function(r){
       return !pikan.is_common_exception(r);
       return !pikan.is_common_exception(r);
Line 186: Line 216:
   //Find "alpha" and "beta".
   //Find "alpha" and "beta".
   reg = /\b(alpha|beta)\b/igm;
   reg = /\b(alpha|beta)\b/igm;
   pikan.regex_check(reg, "Policy", "\"Alpha\" or \"beta\" found. Try \"early\" or \"prototype\" instead.", "Pikipedia:Policy#Prototypes",
   pikan.regex_check(reg, "Policy", "\"Alpha\" or \"beta\" found. Try \"early\" or \"prototype\" instead.", "Pikipedia:General_content_guidelines#Prerelease",
     function(r){
     function(r){
       return !pikan.is_common_exception(r);
       return !pikan.is_common_exception(r);
Line 204: Line 234:
   //Find links to [[Pikmin]].
   //Find links to [[Pikmin]].
   reg = /\[\[Pikmin(\|.+)?\]\]/igm;
   reg = /\[\[Pikmin(\|.+)?\]\]/igm;
   pikan.regex_check(reg, "Policy", "Link to \"Pikmin\" found. Make this a direct link to the family, series or game article.");
   pikan.regex_check(reg, "Policy", "Link to \"Pikmin\" found. Make this a direct link to the family, series, or game article.");
    
    
    
    
Line 210: Line 240:
   reg = /\[\[Challenge Mode(\|.+)?\]\]/igm;
   reg = /\[\[Challenge Mode(\|.+)?\]\]/igm;
   pikan.regex_check(reg, "Policy", "Link to \"Challenge Mode\" found. Make this a direct link to either the first or the second game's Challenge Mode article.");
   pikan.regex_check(reg, "Policy", "Link to \"Challenge Mode\" found. Make this a direct link to either the first or the second game's Challenge Mode article.");
 
 
  //Find links to [[Piklopedia]].
  reg = /\[\[Piklopedia(\|.+)?\]\]/igm;
  pikan.regex_check(reg, "Policy", "Link to \"Piklopedia\" found. Make this a direct link to one of the specific game Piklopedia articles.");
    
    
    
    
   //References not using {{refs}}.
   //References not using {{refs}}.
   reg = /<references ?\/>/igm;
   reg = /<references ?\/>/igm;
   pikan.regex_check(reg, "Policy", "&lt;references/&gt; tag found. Use {{refs}} instead.", "Pikipedia:Policy#Miscellaneous");
   pikan.regex_check(reg, "Policy", "&lt;references/&gt; tag found. Use {{refs}} instead.", "Pikipedia:General_content_guidelines#General");
 
 
  //Wikipedia link not using {{w}}.
  reg = /\[\[wikipedia:/igm;
  pikan.regex_check(reg, "Policy", "Link to Wikipedia found. You should use template {{w}} for this.");
    
    
    
    
Line 220: Line 260:
   reg = /= *See also *=/igm;
   reg = /= *See also *=/igm;
   if(reg.exec(pikan.text) === null) {
   if(reg.exec(pikan.text) === null) {
     pikan.save_problem(0, 0, "Policy", "\"See also\" section not found.", "Pikipedia:Policy#General");
     pikan.save_problem(0, 0, "Policy", "\"See also\" section not found. You should add one if there are any relevant articles to link to.", "Pikipedia:General_content_guidelines#General");
   }
   }


Line 226: Line 266:
   //"Battle Strategy" sections should only be called "Strategy".
   //"Battle Strategy" sections should only be called "Strategy".
   reg = /^=+ +(Battle|Killing) Strategy +=+$/igm;
   reg = /^=+ +(Battle|Killing) Strategy +=+$/igm;
   pikan.regex_check(reg, "Policy", "Strategy sections should be called \"Strategy\".", "Pikipedia:Policy#Order_for_common_sections");
   pikan.regex_check(reg, "Policy", "Strategy sections should be called \"Strategy\".", "Pikipedia:General_content_guidelines#Order_for_common_sections");
    
    
    
    
   //"External links" sections with bad names.
   //"External links" sections with bad names.
   reg = /^=+ +(Web Links|External Pages) +=+$/igm;
   reg = /^=+ +(Web Links|External Pages) +=+$/igm;
   pikan.regex_check(reg, "Policy", "External link sections should be called \"External links\".", "Pikipedia:Policy#Order_for_common_sections");
   pikan.regex_check(reg, "Policy", "External link sections should be called \"External links\".", "Pikipedia:General_content_guidelines#Order_for_common_sections");
    
    
    
    
   //Links in section headers.
   //Links in section headers.
   reg = /==.*\[\[.+\]\].*==/gm;
   reg = /==.*\[\[.+\]\].*==/gm;
   pikan.regex_check(reg, "Policy", "Section headers shouldn't have links.", "Pikipedia:Policy#Headings");
   pikan.regex_check(reg, "Policy", "Section headers shouldn't have links.", "Pikipedia:General_content_policy#Headings");
    
    
    
    
   //Bold in section headers.
   //Bold in section headers.
   reg = /==.*'''.+'''.*==/gm;
   reg = /==.*'''.+'''.*==/gm;
   pikan.regex_check(reg, "Policy", "Section headers shouldn't have bold text.", "Pikipedia:Policy#Headings");
   pikan.regex_check(reg, "Policy", "Section headers shouldn't have bold text.", "Pikipedia:General_content_policy#Headings");
    
    
    
    
   //Title case section header.
   //Title case section header.
   reg = /^\=+ +[A-Z].+ +[A-Z].*\=+$/gm;
   reg = /^\=+ ?[A-Z].+ +[A-Z].*\=+$/gm;
   pikan.regex_check(reg, "Question", "This section header seems to be in title case. Make sure you don't capitalize words unless they are a title.", "Pikipedia:Policy#Headings");
   pikan.regex_check(reg, "Question", "This section header seems to be in title case. Make sure you don't capitalize words unless they are a title.", "Pikipedia:General_content_policy#Headings");
    
    
    
    
Line 284: Line 324:
   }
   }
   if(disorderer != -1){
   if(disorderer != -1){
     pikan.save_problem(secs[disorderer].pos, secs[disorderer].len, "Policy", "Section \"" + secs[disorderer].name + "\" appears after section \"" + secs[disorderer - 1].name + "\"; it should appear before.", "Pikipedia:Policy#Order_for_common_sections");
     pikan.save_problem(secs[disorderer].pos, secs[disorderer].len, "Policy", "Section \"" + secs[disorderer].name + "\" appears after section \"" + secs[disorderer - 1].name + "\"; it should appear before.", "Pikipedia:General_content_guidelines#Order_for_common_sections");
   }
   }
    
    
    
    
   //Report if there are no images.
   //Report if there are no images.
   reg = /\[\[File:/igm;
   reg = /\.(png|jpg|jpeg|gif)/igm;
   if(reg.exec(pikan.text) === null) {
   if(reg.exec(pikan.text) === null) {
     reg = /<gallery/igm;
     reg = /\{\{image/igm;
     if(reg.exec(pikan.text) === null) {
     if(reg.exec(pikan.text) === null) {
       reg = /\{\{image/igm;
       pikan.save_problem(0, 0, "Policy", "No image found; articles should have at least one image. Either add some or add the template {{image}}.", "Pikipedia:General_content_guidelines#General");
      if(reg.exec(pikan.text) === null) {
        pikan.save_problem(0, 0, "Policy", "No image found; articles should have at least one image. Either add some or add the template {{image}}.", "Pikipedia:Policy#General");
      }
     }
     }
   }
   }
Line 317: Line 354:
     //First line of text found.
     //First line of text found.
     if(first_paragraph_match[0].indexOf("'''") == -1){
     if(first_paragraph_match[0].indexOf("'''") == -1){
       pikan.save_problem(0, 0, "Question", "The first mention of the subject on the first paragraph should be in bold. It seems that this is not true. If it is, or this policy does not apply here, ignore this.", "Pikipedia:Policy#General");
       pikan.save_problem(0, 0, "Question", "The first mention of the subject on the first paragraph should be in bold. It seems that this is not true. If it is, or this policy does not apply here, ignore this.", "Pikipedia:General_content_guidelines#General");
       break;
       break;
     }
     }
Line 327: Line 364:
   reg = /\b(you|your|you're)\b/igm;
   reg = /\b(you|your|you're)\b/igm;
   pikan.regex_check(
   pikan.regex_check(
     reg, "Question", "The player/reader is referred to as \"you\". This is only okay on guide sections, and it looks like this section isn't one, as it's missing the {{guide}} template.", "Pikipedia:Policy#Perspective",
     reg, "Question", "The player/reader is referred to as \"you\". This is only okay on guide sections, and it looks like this section isn't one, as it's missing the {{guide}} template.", "Pikipedia:General_content_policy#Don.27t_use_.22you.22",
     function(r){
     function(r){
       if(pikan.in_area(r, "<ref", "/ref", false)) return false;
       if(pikan.in_area(r, "<ref", "/ref", false)) return false;
      if(pikan.in_area(r, "{{transcript", "}}", false)) return false;
      if(pikan.in_area(r, "{{cite", "}}", false)) return false;
       var guide_reg = /\{\{guide/igm;
       var guide_reg = /\{\{guide/igm;
       var guide_tem_match = null;
       var guide_tem_match = null;
Line 361: Line 400:
    
    
   //"Artwork" sections should be called "Gallery".
   //"Artwork" sections should be called "Gallery".
   reg = /^\=+ +(Artwork|Images)\ +=+$/igm;
   reg = /^=+ *(Artwork|Images) *=+$/igm;
   pikan.regex_check(reg, "Question", "Gallery section found. For the sake of consistency, name this section \"Gallery\". However, if this particular gallery only has artwork, you may call it \"Artwork\".");
   pikan.regex_check(reg, "Question", "Gallery section found. For the sake of consistency, name this section \"Gallery\". However, if this particular gallery only has artwork, you may call it \"Artwork\".");
    
    
Line 383: Line 422:
   reg = /\{\{game icons/igm;
   reg = /\{\{game icons/igm;
   if(reg.exec(pikan.text) === null) {
   if(reg.exec(pikan.text) === null) {
     pikan.save_problem(0, 0, "Question", "{{game icons}} template not found. If this page doesn't have game icons on the top right, but should, add the template manually.", "Pikipedia:Policy#General");
     reg = /\{\{infobox/igm; //Infoboxes typically place icons automatically.
    if(reg.exec(pikan.text) === null) {
      pikan.save_problem(0, 0, "Question", "{{game icons}} template not found. If this page doesn't have game icons on the top right, but should, add the template manually.", "Pikipedia:General_content_guidelines#General");
    }
   }
   }
    
    
Line 401: Line 443:
   //Find gendered nouns; enemies should be "it", and players should be "they".
   //Find gendered nouns; enemies should be "it", and players should be "they".
   reg = /\b(his|him|her|he|she)\b/igm;
   reg = /\b(his|him|her|he|she)\b/igm;
   pikan.regex_check(reg, "Question", "Gendered noun found. If this is an enemy, treat it as an \"it\", and if it's the player, treat them as \"they\". Otherwise, ignore this.", "Pikipedia:Policy#Perspective");
   pikan.regex_check(reg, "Question", "Gendered noun found. If this is an enemy, treat it as an \"it\", and if it's the player, treat them as \"they\". Otherwise, ignore this.", "Pikipedia:General_content_guidelines#General");
   
 
 
 
  //Suggest {{cite}} templates instead of <ref> tags.
  reg = /<ref/igm;
  pikan.regex_check(reg, "Question", "Reference tag found. Are you sure you want a raw tag and not one of the templates on [[Category:Citation templates]]?");
 
 
   //Find "center position" info for galleries.
   //Find "center position" info for galleries.
   reg = /position ?= ?"?center"?/igm;
   reg = /position ?= ?"?center"?/igm;
Line 430: Line 477:
    
    
   //Reference tags with a space before them.
   //Reference tags with a space before them.
   reg = / \<ref/igm;
   reg = / (<ref|\{\{cite)/igm;
   pikan.regex_check(reg, "Style", "Reference tags shouldn't have spaces before them.");
   pikan.regex_check(reg, "Style", "References shouldn't have spaces before them.");
    
    
    
    
   //Find trailing spaces.
   //Find trailing spaces.
   reg = /(^ .+$|^.+ $)/igm;
   reg = /(^ .+$|^.+ $)/igm;
   pikan.regex_check(reg, "Style", "Trailing space found.");
   pikan.regex_check(
    reg, "Style", "Trailing space found.", null,
    function(r){
      if(r[0].match(/^\|.+= */)) return false; //Template parameter -- not eligible.
      return true;
    }
  );
    
    
    
    
Line 444: Line 497:
     reg, "Style", "Double spaces found. Just one is enough.", null,
     reg, "Style", "Double spaces found. Just one is enough.", null,
     function(r){
     function(r){
       return !pikan.in_area(r, "|", "="); //Template parameter -- not illegible.
       return !pikan.in_area(r, "|", "="); //Template parameter -- not eligible.
     }
     }
   );
   );
Line 553: Line 606:
}
}


pikan.setup();
 
}
 
if(typeof(pikan) != "undefined") {
  init_pikan();
  pikan.setup();
}


//</nowiki>
//</nowiki>