<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FAhecht%2Furl-access</id>
	<title>Module:Sandbox/Ahecht/url-access - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FAhecht%2Furl-access"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Ahecht/url-access&amp;action=history"/>
	<updated>2026-05-24T10:49:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/Ahecht/url-access&amp;diff=145080&amp;oldid=prev</id>
		<title>imported&gt;Ahecht: create</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Ahecht/url-access&amp;diff=145080&amp;oldid=prev"/>
		<updated>2018-10-03T14:47:25Z</updated>

		<summary type="html">&lt;p&gt;create&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
local cfg = mw.loadData(&amp;quot;Module:Citation/CS1/Configuration&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local function safe_for_url( str )&lt;br /&gt;
	return str:gsub( &amp;#039;[%[%]\n]&amp;#039;, {	&lt;br /&gt;
		[&amp;#039;[&amp;#039;] = &amp;#039;&amp;amp;#91;&amp;#039;,&lt;br /&gt;
		[&amp;#039;]&amp;#039;] = &amp;#039;&amp;amp;#93;&amp;#039;,&lt;br /&gt;
		[&amp;#039;\n&amp;#039;] = &amp;#039; &amp;#039; } );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function external_link( URL, label, source, access)&lt;br /&gt;
	local base_url;&lt;br /&gt;
	&lt;br /&gt;
	if not is_set( label ) then&lt;br /&gt;
		base_url = URL&lt;br /&gt;
	else&lt;br /&gt;
		local domain, path = URL:match (&amp;#039;^([/%.%-%+:%a%d]+)([/%?#].*)$&amp;#039;);		-- split the url into scheme plus domain and path&lt;br /&gt;
		if path then															-- if there is a path portion&lt;br /&gt;
			path = path:gsub (&amp;#039;[%[%]]&amp;#039;, {[&amp;#039;[&amp;#039;]=&amp;#039;%5b&amp;#039;,[&amp;#039;]&amp;#039;]=&amp;#039;%5d&amp;#039;});				-- replace &amp;#039;[&amp;#039; and &amp;#039;]&amp;#039; with their percent encoded values&lt;br /&gt;
			URL = table.concat ({domain, path});								-- and reassemble&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		base_url = table.concat({ &amp;quot;[&amp;quot;, URL, &amp;quot; &amp;quot;, safe_for_url (label), &amp;quot;]&amp;quot; });	-- assemble a wikimarkup url&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if is_set (access) then														-- access level (subscription, registration, limited)&lt;br /&gt;
		base_url = substitute (cfg.presentation[&amp;#039;ext-link-access-signal&amp;#039;], {cfg.presentation[access].class, cfg.presentation[access].title, base_url});	-- add the appropriate icon&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return base_url;&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>imported&gt;Ahecht</name></author>
	</entry>
</feed>