Module:Television episode disambiguation description/sandbox explained

-- Do not add a style which is not supported by the guidelines.

-- This module requires the use of Module:Extract short description.local extract = require('Module:Extract short description');

-- Release version template list.local releaseTemplates =

-- Disambiugation template list.local disambiguationTemplateNameList =

-- Tracking category list. local trackingCategoryList =

local p =

-- Local function used to check if the invoking page is a disambiguation page.local function isInvokedFromDisambiguationPage(articleTitle) local content = mw.title.new(articleTitle):getContent; -- Read the unparsed article source. for _, templateName in ipairs(disambiguationTemplateNameList) do -- Loop through the template names in the list. local templateNamePattern templateNamePattern = templateName:gsub('^%a', string.lower) -- If the first character of the template is an alpha character, make it lowercase: B → b. templateNamePattern = templateNamePattern:gsub('^%a', '%[%1%1%]') -- If the first character of the template is an alpha character, make it a pair: b → bb and wrap the pair in set markup: bb → [bb]. templateNamePattern = templateNamePattern:gsub('%[%a', string.upper) -- If the first character of the template is "[" followed by an alpha character, make the alpha character uppercase: [bb] → [Bb].

local templateFound = content:find('