<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://elite.mistflux.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ADYK_queue_formatting_check</id>
	<title>Module:DYK queue formatting check - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://elite.mistflux.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ADYK_queue_formatting_check"/>
	<link rel="alternate" type="text/html" href="https://elite.mistflux.co.uk/w/index.php?title=Module:DYK_queue_formatting_check&amp;action=history"/>
	<updated>2026-10-31T22:22:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://elite.mistflux.co.uk/w/index.php?title=Module:DYK_queue_formatting_check&amp;diff=127470&amp;oldid=prev</id>
		<title>Wikipedia&gt;Staraction: added a space between two words</title>
		<link rel="alternate" type="text/html" href="https://elite.mistflux.co.uk/w/index.php?title=Module:DYK_queue_formatting_check&amp;diff=127470&amp;oldid=prev"/>
		<updated>2025-12-13T06:02:20Z</updated>

		<summary type="html">&lt;p&gt;added a space between two words&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module started out verifying punctuation rules unique to [[WP:DYKMOS]]&lt;br /&gt;
-- Then it expanded to include the remaining non-subjective part of&lt;br /&gt;
-- [[WP:DYKMOS]] and [[MOS:CQ]] to keep formatting errors from [[WP:MP/E]]&lt;br /&gt;
&lt;br /&gt;
-- If there&amp;#039;s a false positive with a hook and the warning is too annoying,&lt;br /&gt;
-- the current method is to just disableAll.&lt;br /&gt;
&lt;br /&gt;
-- This module doesn&amp;#039;t show up on the main page or prevent promotion,&lt;br /&gt;
-- but if a problem arises:&lt;br /&gt;
local disableAll = false&lt;br /&gt;
-- This module is not [[WP:EXPENSIVE]], but if performance becomes a problem:&lt;br /&gt;
local disableTransclusionBasedChecks = false&lt;br /&gt;
-- People don&amp;#039;t seem to care about [[MOS:SOB]]. [[Special:Diff/1282220073]]&lt;br /&gt;
-- could be edited but [[Special:Diff/1281992817]] might be intentional&lt;br /&gt;
local disableSeaOfBlueCheck = true&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local plainText = require(&amp;quot;Module:Plain text&amp;quot;)._main&lt;br /&gt;
local isDisambiguation = require(&amp;#039;Module:Disambiguation&amp;#039;).isDisambiguation&lt;br /&gt;
local getTargetFromText = require(&amp;#039;Module:Redirect&amp;#039;).getTargetFromText&lt;br /&gt;
local decode = require(&amp;#039;Module:DecodeEncode&amp;#039;)._decode&lt;br /&gt;
&lt;br /&gt;
-- Checks that look at the destination page of a wikilink&lt;br /&gt;
local function check_link(page)&lt;br /&gt;
	if disableTransclusionBasedChecks then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	local title = mw.title.new(page)&lt;br /&gt;
	local content = title.content&lt;br /&gt;
	if not content then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: The hook must not contain redlinks: &amp;quot; .. page&lt;br /&gt;
	end&lt;br /&gt;
	local target = getTargetFromText(content)&lt;br /&gt;
	if target then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]/[[WP:MPNOREDIRECT]]: The hook must not &amp;quot; ..&lt;br /&gt;
		&amp;quot;contain redirects: [[&amp;quot; .. page .. &amp;quot;]] → [[&amp;quot; .. target .. &amp;quot;]]&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if isDisambiguation(content) then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: The hook must not contain links to &amp;quot; ..&lt;br /&gt;
		&amp;quot;disambiguation pages: &amp;quot; .. page&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Per-hook checks that may have occasional exceptions&lt;br /&gt;
local function check_hook(wikitextLine, expandedLine, decodedLine, hookNum)&lt;br /&gt;
	if ((expandedLine:find(&amp;quot;{{&amp;quot;) and not wikitextLine:find(&amp;quot;{{%(&amp;quot;))&lt;br /&gt;
		or (expandedLine:find(&amp;quot;}}&amp;quot;) and not wikitextLine:find(&amp;quot;{{%)&amp;quot;))&lt;br /&gt;
		or (expandedLine:find(&amp;quot;%[%[&amp;quot;) and not wikitextLine:find(&amp;quot;{{!&amp;quot;))&lt;br /&gt;
		or (expandedLine:find(&amp;quot;%]%]&amp;quot;) and not wikitextLine:find(&amp;quot;!}}&amp;quot;))) then&lt;br /&gt;
	    -- &amp;quot;code&amp;quot; is not ignored because some hooks use the word &amp;quot;codename&amp;quot;&lt;br /&gt;
	    -- Use templates or HTML alternatives from&lt;br /&gt;
	    -- [[Template:Escape template list]] if there&amp;#039;s actually code in a hook.&lt;br /&gt;
	    return &amp;quot;Potentially broken wikitext&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local byteCount = -1 -- Counting ends at the question mark&lt;br /&gt;
	if wikitextLine:find(&amp;quot;&amp;#039;&amp;#039;%([^)]+%)&amp;#039;&amp;#039;&amp;quot;) then&lt;br /&gt;
		-- The eleven characters in a &amp;#039;&amp;#039;(pictured)&amp;#039;&amp;#039; tag do not count&lt;br /&gt;
		byteCount = byteCount - 11&lt;br /&gt;
	end&lt;br /&gt;
	local boldLinkFound = false&lt;br /&gt;
	for wikilink in wikitextLine:gmatch(&amp;quot;&amp;#039;&amp;#039;&amp;#039;%[%[([^]]+)%]%]&amp;quot;) do&lt;br /&gt;
		-- Text in boldlinks after the first do not count toward the limit&lt;br /&gt;
		if boldLinkFound then&lt;br /&gt;
			wikilink = wikilink:gsub(&amp;quot;[^|]+|&amp;quot;, &amp;quot;&amp;quot;, 1)&lt;br /&gt;
			byteCount = byteCount - #wikilink&lt;br /&gt;
		end&lt;br /&gt;
		boldLinkFound = true&lt;br /&gt;
	end&lt;br /&gt;
	byteCount = byteCount + #decodedLine&lt;br /&gt;
	if byteCount &amp;gt; 200 then&lt;br /&gt;
		return &amp;quot;[[WP:DYK200]]: The hook cannot exceed 200 prose characters. &amp;quot; ..&lt;br /&gt;
		&amp;quot;It is currently &amp;quot; .. byteCount .. &amp;quot; characters&amp;quot;&lt;br /&gt;
	elseif byteCount &amp;lt; 1 then&lt;br /&gt;
		if hookNum == 1 then&lt;br /&gt;
			return &amp;#039;Empty first hooks are usually written as &amp;quot;... that ... &amp;#039; ..&lt;br /&gt;
			&amp;quot;&amp;#039;&amp;#039;(pictured)&amp;#039;&amp;#039; ...\&amp;quot;&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;#039;Empty hooks are usually written as &amp;quot;... that ...&amp;quot;&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if hookNum &amp;gt; 1 then&lt;br /&gt;
		if wikitextLine:find(&amp;quot;&amp;#039;&amp;#039;%([^)]+%)&amp;#039;&amp;#039;&amp;quot;) then&lt;br /&gt;
			return &amp;quot;[[WP:DYKIMG]]/[[WP:DYKMOS]]: Extra &amp;#039;&amp;#039;(pictured)&amp;#039;&amp;#039; or &amp;quot; ..&lt;br /&gt;
			&amp;quot;alternative&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif hookNum &amp;lt; 0 then&lt;br /&gt;
		-- First hook might have been skipped by opt-out&lt;br /&gt;
	else&lt;br /&gt;
		if not decodedLine:find(&amp;quot;%([^)]+%)&amp;quot;) then&lt;br /&gt;
			return &amp;quot;[[WP:DYKIMG]]/[[WP:DYKMOS]]: Missing &amp;#039;&amp;#039;(pictured)&amp;#039;&amp;#039; or &amp;quot; ..&lt;br /&gt;
			&amp;quot;alternative&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		-- Parentheses that are not the media marker are&lt;br /&gt;
		-- allowed if &amp;quot;absolutely unavoidable&amp;quot;.&lt;br /&gt;
		-- Italic markup is not tested for because it might be complicated by&lt;br /&gt;
		-- adjacent bold markup.&lt;br /&gt;
	end&lt;br /&gt;
	if not disableSeaOfBlueCheck then&lt;br /&gt;
		if (string.find(wikitextLine, &amp;quot;%]%] *%[%[&amp;quot;)&lt;br /&gt;
			or string.find(wikitextLine, &amp;quot;%]%] *&amp;#039;&amp;#039;&amp;#039;+ *&amp;#039;&amp;#039;&amp;#039;+ *%[%[&amp;quot;)) then&lt;br /&gt;
			return &amp;quot;[[WP:DYKMOS]]/[[MOS:SEAOFBLUE]]: Two non-boldlinks or &amp;quot; ..&lt;br /&gt;
			&amp;quot;two boldlinks must be kept separate&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if decodedLine:byte(-1) ~= 46 then -- Not an empty hook in prep area&lt;br /&gt;
		if not boldLinkFound then&lt;br /&gt;
			return &amp;quot;[[WP:DYKMOS]]: Every eligible article in the hook &amp;quot; ..&lt;br /&gt;
			&amp;quot;should be linked and wrapped in bold markup&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		if decodedLine:byte(-1) ~= 63 then&lt;br /&gt;
			return &amp;quot;[[WP:DYKMOS]]: A hook should end in a question mark&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if mw.ustring.find(decodedLine, (&amp;quot;[“”]&amp;quot;)) then&lt;br /&gt;
		return &amp;#039;[[MOS:CURLY]]: Use &amp;quot;straight&amp;quot; quotation marks, not “curly” ones&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	if mw.ustring.find(decodedLine, &amp;quot;[‘’]&amp;quot;) then&lt;br /&gt;
		return &amp;quot;[[MOS:APOSTROPHE]]: Use straight apostrophes (&amp;#039;), &amp;quot; ..&lt;br /&gt;
		&amp;quot;not curly apostrophes (‘ or ’)&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	-- Only humans can check if {{lang}} and {{transl}} are needed i.e. if&lt;br /&gt;
	-- the &amp;quot;non-English and transliterated text&amp;quot; is in &amp;quot;common English usage&amp;quot;&lt;br /&gt;
	-- [[WP:DYKMOS]] says that only &amp;#039;&amp;#039;most&amp;#039;&amp;#039; hooks begin with &amp;quot;that&amp;quot;&lt;br /&gt;
	-- [[MOS:CONTRACTION]] doesn&amp;#039;t apply to quotes&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- General checks that should be uncontroversial for the entire page&lt;br /&gt;
local function general_checks(content)&lt;br /&gt;
	if content:find(&amp;quot;[^[]%[//&amp;quot;) or content:find(&amp;quot;https?://&amp;quot;) then&lt;br /&gt;
		-- Assuming nobody inserts a [[mw:Help:Links|mailto]] link&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: The hook must not contain external links&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if content:find(&amp;quot;|&amp;#039;&amp;#039;[^]]+&amp;#039;&amp;#039;%]&amp;quot;) then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: Markup should go on the outside of the link &amp;quot; ..&lt;br /&gt;
		&amp;quot;if possible&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if content:find(&amp;quot;%(&amp;#039;&amp;#039;[^)]*pictured[^)]*&amp;#039;&amp;#039;%)&amp;quot;) then&lt;br /&gt;
		-- Media markers should be &amp;#039;&amp;#039;(pictured)&amp;#039;&amp;#039; like at&lt;br /&gt;
		-- [[Special:Diff/1287459353]] or similar,&lt;br /&gt;
		-- usually just with an extra word.&lt;br /&gt;
		-- But this shouldn&amp;#039;t affect species, like&lt;br /&gt;
		-- (&amp;#039;&amp;#039;Sitta pusilla&amp;#039;&amp;#039;) at [[Special:Diff/1290843555]]&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: Note that the italics should sit outside the &amp;quot;&lt;br /&gt;
		.. &amp;quot;parentheses&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if content:find(&amp;quot;%(disambiguation%)&amp;quot;) then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: The hook must not contain links to &amp;quot; ..&lt;br /&gt;
		&amp;quot;disambiguation pages&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local delinkedContent = content:gsub(&amp;quot;%]&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	if (delinkedContent:find(&amp;quot;[^&amp;#039;]&amp;#039;&amp;#039;%?&amp;quot;)&lt;br /&gt;
		or delinkedContent:find(&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;%?&amp;quot;)&lt;br /&gt;
		or delinkedContent:find(&amp;quot;[ ;?]%?&amp;quot;)) then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: There should not be a space before the &amp;quot; ..&lt;br /&gt;
		&amp;quot;question mark, but if the text directly preceding it is &amp;quot; ..&lt;br /&gt;
		&amp;quot;italicized, the {{-?}} tag can offset it.&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if delinkedContent:find(&amp;quot;[^&amp;#039;]&amp;#039;&amp;#039;&amp;#039;{{%-%?}}&amp;quot;) then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: (Only) if the text directly preceding it is &amp;quot; ..&lt;br /&gt;
		&amp;quot;italicized, the {{-?}} tag can offset it.&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if delinkedContent:find(&amp;quot;&amp;#039;&amp;#039;s &amp;quot;) then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: Keep the bold / italic (or bold italic) text &amp;quot; ..&lt;br /&gt;
		&amp;quot;and the apostrophe distinct using {{`s}}/{{&amp;#039;s}} respectively&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if (delinkedContent:find(&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;#039;{{`&amp;quot;) -- Use {{&amp;#039;}} with bold italic&lt;br /&gt;
		or delinkedContent:find(&amp;quot;[^&amp;#039;]&amp;#039;&amp;#039;{{`&amp;quot;) -- Use {{&amp;#039;}} with italic&lt;br /&gt;
		or delinkedContent:find(&amp;quot;[^&amp;#039;]&amp;#039;&amp;#039;&amp;#039;{{&amp;#039;&amp;quot;)) then -- Use {{`}} with bold&lt;br /&gt;
		-- Adapted from [[Template:Quotation mark templates]]&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: {{`}} (or {{`s}}) is for adjacent bold &amp;quot; ..&lt;br /&gt;
		&amp;quot;markup; {{&amp;#039;}} (or {{&amp;#039;s}}) is for adjacent italic (or bold italic)&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if (delinkedContent:find(&amp;quot;[^&amp;#039;] *{{&amp;#039;s}}&amp;quot;)) then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: {{&amp;#039;s}} is only for italics&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if content:find(&amp;quot;\n%*%.%.%.&amp;quot;) then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: The three dots should be preceded by a space&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if content:find(&amp;quot;\n%* %.%.%.that&amp;quot;) then&lt;br /&gt;
		return &amp;quot;[[WP:DYKMOS]]: The three dots should be followed by a space&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Checks to use for queues and complete prep areas&lt;br /&gt;
local function check_queue(content)&lt;br /&gt;
	if content:find(&amp;quot;example%-serious%.jpg&amp;quot;) then&lt;br /&gt;
		return &amp;quot;Image is still \&amp;quot;example-serious.jpg\&amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if content:find(&amp;quot;Caption goes here&amp;quot;) then&lt;br /&gt;
		return &amp;quot;Caption is still \&amp;quot;Caption goes here\&amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	for article in content:gmatch(&amp;quot;\n%* *%{%{DYK[^\n|]+|([^\n|]+)|&amp;quot;) do&lt;br /&gt;
		article = article:lower()&lt;br /&gt;
		if article == &amp;quot;example&amp;quot; or article == &amp;quot;articlename&amp;quot; then&lt;br /&gt;
			return &amp;quot;[[WP:DYKPBI]]: DYKmake or DYKnom article is still &amp;quot; ..&lt;br /&gt;
			&amp;#039;&amp;quot;Example&amp;quot;/&amp;quot;ArticleName&amp;quot;&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Run all checks&lt;br /&gt;
-- Useful for the debug console:&lt;br /&gt;
-- =p._check(&amp;quot;\n* ... that &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;[[Main Page]]&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; test &amp;#039;&amp;#039;(pictured)&amp;#039;&amp;#039; test?\n&amp;quot;)&lt;br /&gt;
function p._check(content)&lt;br /&gt;
	local generalProblem = general_checks(content)&lt;br /&gt;
	if generalProblem then&lt;br /&gt;
		return generalProblem&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local hookNum = 1&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	-- Counting starts from after the space following the three dots&lt;br /&gt;
	for wikitextLine in content:gmatch(&amp;quot;\n%* *%.%.%. *([^\n]*)&amp;quot;) do&lt;br /&gt;
		wikitextLine = wikitextLine:gsub(&amp;quot; *%[%[File:Symbol confirmed%.svg.+$&amp;quot;,&lt;br /&gt;
			&amp;quot;&amp;quot;) -- {{subst:dyktick}}&lt;br /&gt;
		local expandedLine = frame:preprocess(wikitextLine)&lt;br /&gt;
		expandedLine = plainText(expandedLine, false)&lt;br /&gt;
		local decodedLine = decode(expandedLine)&lt;br /&gt;
		local hookProblem = check_hook(wikitextLine, expandedLine,&lt;br /&gt;
									   decodedLine, hookNum)&lt;br /&gt;
		if hookProblem then&lt;br /&gt;
			return hookProblem .. &amp;quot;: &amp;quot; .. decodedLine&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		for page in wikitextLine:gmatch(&amp;quot;%[%[([^]|]+)|?[^]]*%]%]&amp;quot;) do&lt;br /&gt;
			local linkProblem = check_link(page)&lt;br /&gt;
			if linkProblem then&lt;br /&gt;
				return linkProblem&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		hookNum = hookNum + 1&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- No empty hooks (&amp;quot;... that ...&amp;quot;) = queue or completed prep area&lt;br /&gt;
	if not content:find(&amp;quot;\n%* %.%.%. that[^\n]*%.%.%.\n&amp;quot;) then&lt;br /&gt;
		local queueProblem = check_queue(content)&lt;br /&gt;
		if queueProblem then&lt;br /&gt;
			return queueProblem&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	if disableAll then&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local message = p._check(mw.title.getCurrentTitle().content)&lt;br /&gt;
	if message then&lt;br /&gt;
		return frame:expandTemplate{title = &amp;quot;Ombox&amp;quot;, args = {type = &amp;quot;style&amp;quot;,&lt;br /&gt;
			text = &amp;#039;&amp;lt;p style=&amp;quot;color:var(--color-error,#bf3c2c);font-weight:&amp;#039; ..&lt;br /&gt;
				&amp;#039;bold&amp;quot;&amp;gt;&amp;#039; .. message .. &amp;quot;&amp;lt;/p&amp;gt;&amp;quot; .. frame:expandTemplate{&lt;br /&gt;
					title = &amp;quot;Navbar&amp;quot;,&lt;br /&gt;
					args = {&lt;br /&gt;
						&amp;quot;Module:DYK queue formatting check&amp;quot;,&lt;br /&gt;
						text = &amp;quot;This warning module:&amp;quot;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
		}}&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Wikipedia&gt;Staraction</name></author>
	</entry>
</feed>