<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AURL</id>
	<title>Module:URL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AURL"/>
	<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;action=history"/>
	<updated>2026-04-06T06:49:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=38075&amp;oldid=prev</id>
		<title>imported&gt;Paine Ellsworth: per edit request on talk page - update</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=38075&amp;oldid=prev"/>
		<updated>2022-09-11T18:55:11Z</updated>

		<summary type="html">&lt;p&gt;per edit request on talk page - update&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:55, 11 September 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l54&quot;&gt;Line 54:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 54:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- If it&amp;#039;s an HTTP[S] URL without the double slash, fix it.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- If it&amp;#039;s an HTTP[S] URL without the double slash, fix it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	url = mw.ustring.gsub(url, &amp;#039;^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])&amp;#039;, &amp;#039;http%1://%3&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	url = mw.ustring.gsub(url, &amp;#039;^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])&amp;#039;, &amp;#039;http%1://%3&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	-- Handle URLs from Wikidata of the format http&amp;amp;#58;//&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	url = mw.ustring.gsub(url, &#039;^[Hh][Tt][Tt][Pp]([Ss]?)&amp;amp;#58;//&#039;, &#039;http%1://&#039;)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local uri = safeUri(url)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local uri = safeUri(url)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key uk_vapewiki:diff:1.41:old-6317:rev-38075:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Paine Ellsworth</name></author>
	</entry>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=6317&amp;oldid=prev</id>
		<title>Richardpruen: 1 revision imported: Template for journal </title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=6317&amp;oldid=prev"/>
		<updated>2021-08-25T03:50:29Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported: Template for journal &lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:50, 25 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key uk_vapewiki:diff:1.41:old-6316:rev-6317 --&gt;
&lt;/table&gt;</summary>
		<author><name>Richardpruen</name></author>
	</entry>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=6316&amp;oldid=prev</id>
		<title>Wikipedia&gt;MSGJ: fixes for pen icon</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=6316&amp;oldid=prev"/>
		<updated>2021-01-05T07:56:15Z</updated>

		<summary type="html">&lt;p&gt;fixes for pen icon&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:56, 5 January 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l116&quot;&gt;Line 116:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 116:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local msg = templateArgs.msg or parentArgs.msg or &amp;#039;no&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local msg = templateArgs.msg or parentArgs.msg or &amp;#039;no&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or &amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or &amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	-- if the url came from a Wikidata call, it might have a pen icon appended&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	-- we want to keep that and add it back at the end.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	local u1, penicon = mw.ustring.match( url, &quot;(.*)(&amp;amp;nbsp;&amp;lt;span class=&#039;penicon.*)&quot; )&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	if penicon then url = u1 end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- strip out html tags and [ ] from url&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- strip out html tags and [ ] from url&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	url = (url or &amp;#039;&amp;#039;):gsub(&amp;quot;&amp;lt;[^&amp;gt;]*&amp;gt;&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;[%[%]]&amp;quot;, &amp;quot;&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	url = (url or &amp;#039;&amp;#039;):gsub(&amp;quot;&amp;lt;[^&amp;gt;]*&amp;gt;&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;[%[%]]&amp;quot;, &amp;quot;&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- truncate anything after a space&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- truncate anything after a space&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	url = url:gsub(&amp;quot;%%20&amp;quot;, &amp;quot; &amp;quot;):gsub(&amp;quot; .*&amp;quot;, &amp;quot;&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	url = url:gsub(&amp;quot;%%20&amp;quot;, &amp;quot; &amp;quot;):gsub(&amp;quot; .*&amp;quot;, &amp;quot;&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	return p._url(url, text, msg)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	return &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(&lt;/ins&gt;p._url(url, text, msg&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;) or &quot;&quot;) .. (penicon or &quot;&quot;&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;return p&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;return p&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key uk_vapewiki:diff:1.41:old-2873:rev-6316:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Wikipedia&gt;MSGJ</name></author>
	</entry>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=2873&amp;oldid=prev</id>
		<title>Richardpruen: 1 revision imported: Wikipedia article on Nicotine templates needed</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=2873&amp;oldid=prev"/>
		<updated>2020-12-12T16:56:00Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported: Wikipedia article on Nicotine templates needed&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:56, 12 December 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key uk_vapewiki:diff:1.41:old-2872:rev-2873 --&gt;
&lt;/table&gt;</summary>
		<author><name>Richardpruen</name></author>
	</entry>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=2872&amp;oldid=prev</id>
		<title>wikipedia&gt;Pppery: Making extraction of URLs containing &quot;=&quot; actually work per edit request</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Module:URL&amp;diff=2872&amp;oldid=prev"/>
		<updated>2019-07-26T16:45:29Z</updated>

		<summary type="html">&lt;p&gt;Making extraction of URLs containing &amp;quot;=&amp;quot; actually work per edit request&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--&lt;br /&gt;
-- This module implements {{URL}}&lt;br /&gt;
--&lt;br /&gt;
-- See unit tests at [[Module:URL/testcases]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
 &lt;br /&gt;
local function safeUri(s)&lt;br /&gt;
	local success, uri = pcall(function()&lt;br /&gt;
		return mw.uri.new(s)&lt;br /&gt;
	end)&lt;br /&gt;
	if success then&lt;br /&gt;
		return uri&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function extractUrl(args)&lt;br /&gt;
	for name, val in pairs(args) do&lt;br /&gt;
		if name ~= 2 and name ~= &amp;quot;msg&amp;quot; then&lt;br /&gt;
			local url = name .. &amp;quot;=&amp;quot; .. val;&lt;br /&gt;
			url = mw.ustring.gsub(url, &amp;#039;^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])&amp;#039;, &amp;#039;http%1://%3&amp;#039;)&lt;br /&gt;
			local uri = safeUri(url);&lt;br /&gt;
			if uri and uri.host then&lt;br /&gt;
				return url&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._url(url, text, msg)&lt;br /&gt;
	url = mw.text.trim(url or &amp;#039;&amp;#039;)&lt;br /&gt;
	text = mw.text.trim(text or &amp;#039;&amp;#039;)&lt;br /&gt;
	local nomsg = (msg or &amp;#039;&amp;#039;):sub(1,1):lower() == &amp;quot;n&amp;quot; or msg == &amp;#039;false&amp;#039; -- boolean: true if msg is &amp;quot;false&amp;quot; or starts with n or N&lt;br /&gt;
&lt;br /&gt;
	if url == &amp;#039;&amp;#039; then&lt;br /&gt;
		if text == &amp;#039;&amp;#039; then&lt;br /&gt;
			if nomsg then&lt;br /&gt;
				return nil&lt;br /&gt;
			else&lt;br /&gt;
				return mw.getCurrentFrame():expandTemplate{ title = &amp;#039;tlx&amp;#039;, args = { &amp;#039;URL&amp;#039;, &amp;quot;&amp;#039;&amp;#039;example.com&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;#039;&amp;#039;optional display text&amp;#039;&amp;#039;&amp;quot; } }&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			return text&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- If the URL contains any unencoded spaces, encode them, because MediaWiki will otherwise interpret a space as the end of the URL.&lt;br /&gt;
	url = mw.ustring.gsub(url, &amp;#039;%s&amp;#039;, function(s) return mw.uri.encode(s, &amp;#039;PATH&amp;#039;) end)&lt;br /&gt;
&lt;br /&gt;
	-- If there is an empty query string or fragment id, remove it as it will cause mw.uri.new to throw an error&lt;br /&gt;
	url = mw.ustring.gsub(url, &amp;#039;#$&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	url = mw.ustring.gsub(url, &amp;#039;%?$&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	-- If it&amp;#039;s an HTTP[S] URL without the double slash, fix it.&lt;br /&gt;
	url = mw.ustring.gsub(url, &amp;#039;^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])&amp;#039;, &amp;#039;http%1://%3&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	-- Handle URLs from Wikidata of the format http&amp;amp;#58;//&lt;br /&gt;
	url = mw.ustring.gsub(url, &amp;#039;^[Hh][Tt][Tt][Pp]([Ss]?)&amp;amp;#58;//&amp;#039;, &amp;#039;http%1://&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	local uri = safeUri(url)&lt;br /&gt;
&lt;br /&gt;
	-- Handle URL&amp;#039;s without a protocol and URL&amp;#039;s that are protocol-relative, &lt;br /&gt;
	-- e.g. www.example.com/foo or www.example.com:8080/foo, and //www.example.com/foo&lt;br /&gt;
	if uri and (not uri.protocol or (uri.protocol and not uri.host)) and url:sub(1, 2) ~= &amp;#039;//&amp;#039; then&lt;br /&gt;
		url = &amp;#039;http://&amp;#039; .. url&lt;br /&gt;
		uri = safeUri(url)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if text == &amp;#039;&amp;#039; then&lt;br /&gt;
		if uri then&lt;br /&gt;
			if uri.path == &amp;#039;/&amp;#039; then uri.path = &amp;#039;&amp;#039; end&lt;br /&gt;
&lt;br /&gt;
			local port = &amp;#039;&amp;#039;&lt;br /&gt;
			if uri.port then port = &amp;#039;:&amp;#039; .. uri.port end&lt;br /&gt;
&lt;br /&gt;
			text = mw.ustring.lower(uri.host or &amp;#039;&amp;#039;) .. port .. (uri.relativePath or &amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
			-- Add &amp;lt;wbr&amp;gt; before _/.-# sequences&lt;br /&gt;
			text = mw.ustring.gsub(text,&amp;quot;(/+)&amp;quot;,&amp;quot;&amp;lt;wbr/&amp;gt;%1&amp;quot;)      -- This entry MUST be the first. &amp;quot;&amp;lt;wbr/&amp;gt;&amp;quot; has a &amp;quot;/&amp;quot; in it, you know.&lt;br /&gt;
			text = mw.ustring.gsub(text,&amp;quot;(%.+)&amp;quot;,&amp;quot;&amp;lt;wbr/&amp;gt;%1&amp;quot;)&lt;br /&gt;
			-- text = mw.ustring.gsub(text,&amp;quot;(%-+)&amp;quot;,&amp;quot;&amp;lt;wbr/&amp;gt;%1&amp;quot;) 	-- DISABLED for now&lt;br /&gt;
			text = mw.ustring.gsub(text,&amp;quot;(%#+)&amp;quot;,&amp;quot;&amp;lt;wbr/&amp;gt;%1&amp;quot;)&lt;br /&gt;
			text = mw.ustring.gsub(text,&amp;quot;(_+)&amp;quot;,&amp;quot;&amp;lt;wbr/&amp;gt;%1&amp;quot;)&lt;br /&gt;
		else -- URL is badly-formed, so just display whatever was passed in&lt;br /&gt;
			text = url&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return mw.ustring.format(&amp;#039;&amp;lt;span class=&amp;quot;url&amp;quot;&amp;gt;[%s %s]&amp;lt;/span&amp;gt;&amp;#039;, url, text)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
The main entry point for calling from Template:URL.&lt;br /&gt;
--]]&lt;br /&gt;
function p.url(frame)&lt;br /&gt;
	local templateArgs = frame.args&lt;br /&gt;
	local parentArgs = frame:getParent().args&lt;br /&gt;
	local url = templateArgs[1] or parentArgs[1]&lt;br /&gt;
	local text = templateArgs[2] or parentArgs[2] or &amp;#039;&amp;#039;&lt;br /&gt;
	local msg = templateArgs.msg or parentArgs.msg or &amp;#039;&amp;#039;&lt;br /&gt;
	url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or &amp;#039;&amp;#039;&lt;br /&gt;
	return p._url(url, text, msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
The entry point for calling from the forked Template:URL2.&lt;br /&gt;
This function returns no message by default.&lt;br /&gt;
It strips out wiki-link markup, html tags, and everything after a space.&lt;br /&gt;
--]]&lt;br /&gt;
function p.url2(frame)&lt;br /&gt;
	local templateArgs = frame.args&lt;br /&gt;
	local parentArgs = frame:getParent().args&lt;br /&gt;
	local url = templateArgs[1] or parentArgs[1]&lt;br /&gt;
	local text = templateArgs[2] or parentArgs[2] or &amp;#039;&amp;#039;&lt;br /&gt;
	-- default to no message&lt;br /&gt;
	local msg = templateArgs.msg or parentArgs.msg or &amp;#039;no&amp;#039;&lt;br /&gt;
	url = url or extractUrl(templateArgs) or extractUrl(parentArgs) or &amp;#039;&amp;#039;&lt;br /&gt;
	-- strip out html tags and [ ] from url&lt;br /&gt;
	url = (url or &amp;#039;&amp;#039;):gsub(&amp;quot;&amp;lt;[^&amp;gt;]*&amp;gt;&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;[%[%]]&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	-- truncate anything after a space&lt;br /&gt;
	url = url:gsub(&amp;quot;%%20&amp;quot;, &amp;quot; &amp;quot;):gsub(&amp;quot; .*&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	return p._url(url, text, msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Pppery</name></author>
	</entry>
</feed>