<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://dogcraft.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AWorldLink</id>
	<title>Module:WorldLink - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dogcraft.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AWorldLink"/>
	<link rel="alternate" type="text/html" href="https://dogcraft.net/wiki/index.php?title=Module:WorldLink&amp;action=history"/>
	<updated>2026-04-06T08:16:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://dogcraft.net/wiki/index.php?title=Module:WorldLink&amp;diff=34737&amp;oldid=prev</id>
		<title>Domino: EXPERIMENTAL: Takes all detected world names in a string and wraps them in [[]] to make them link (DO NOT USE YET)</title>
		<link rel="alternate" type="text/html" href="https://dogcraft.net/wiki/index.php?title=Module:WorldLink&amp;diff=34737&amp;oldid=prev"/>
		<updated>2023-12-29T03:03:30Z</updated>

		<summary type="html">&lt;p&gt;EXPERIMENTAL: Takes all detected world names in a string and wraps them in [[]] to make them link (DO NOT USE YET)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- EXPERIMENTAL&lt;br /&gt;
-- takes all detected world names in a string and wraps them in [[]] to make them link&lt;br /&gt;
&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
local p = {}&lt;br /&gt;
local worldTools = require('Module:World')&lt;br /&gt;
local lang = mw.language.getContentLanguage()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	input = args[1]&lt;br /&gt;
	detectedWorlds = worldTools.extractAllWorlds(input)&lt;br /&gt;
&lt;br /&gt;
	for key,value in ipairs(detectedWorlds) do&lt;br /&gt;
		-- this pattern works for most cases&lt;br /&gt;
		-- - works: survival 4, [[survival 4]] (matches and world names, both if on their own and if already linked, handles it as it should)&lt;br /&gt;
		-- - doesn'T work: [[Grand Central Station (Survival 4)]] produces [[Grand Central Station ([[Survival 4]])]] - if the search term is inside a bigger link already,&lt;br /&gt;
		-- it will double link it&lt;br /&gt;
		-- - this is also case sensitive, but that can probably be solved&lt;br /&gt;
		pattern = &amp;quot;[%[]*&amp;quot; .. value .. &amp;quot;[%]]*&amp;quot;&lt;br /&gt;
	    input = mw.ustring.gsub(input, pattern, &amp;quot;[[&amp;quot; .. lang:ucfirst(value) .. &amp;quot;]]&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return input&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Domino</name></author>
	</entry>
</feed>