<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wikinabia.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ADelink</id>
	<title>Module:Delink - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wikinabia.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ADelink"/>
	<link rel="alternate" type="text/html" href="https://wikinabia.com/index.php?title=Module:Delink&amp;action=history"/>
	<updated>2026-04-07T10:46:18Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.33.1</generator>
	<entry>
		<id>https://wikinabia.com/index.php?title=Module:Delink&amp;diff=6254&amp;oldid=prev</id>
		<title>Docteurmarty : 1 révision importée</title>
		<link rel="alternate" type="text/html" href="https://wikinabia.com/index.php?title=Module:Delink&amp;diff=6254&amp;oldid=prev"/>
		<updated>2019-10-08T06:01:23Z</updated>

		<summary type="html">&lt;p&gt;1 révision importée&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Version du 8 octobre 2019 à 06:01&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;fr&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Aucune différence)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Docteurmarty</name></author>
		
	</entry>
	<entry>
		<id>https://wikinabia.com/index.php?title=Module:Delink&amp;diff=6253&amp;oldid=prev</id>
		<title>fr&gt;Jules78120 : A changé le niveau de protection pour « Module:Delink » : Modèle très utilisé ([Modifier=Autoriser uniquement les utilisateurs autopatrolled] (infini) [Renommer=Autoriser uniquement les utilisateurs autopatrolled] (infini))</title>
		<link rel="alternate" type="text/html" href="https://wikinabia.com/index.php?title=Module:Delink&amp;diff=6253&amp;oldid=prev"/>
		<updated>2019-06-25T09:48:47Z</updated>

		<summary type="html">&lt;p&gt;A changé le niveau de protection pour « &lt;a href=&quot;/Module:Delink&quot; title=&quot;Module:Delink&quot;&gt;Module:Delink&lt;/a&gt; » : Modèle très utilisé ([Modifier=Autoriser uniquement les utilisateurs autopatrolled] (infini) [Renommer=Autoriser uniquement les utilisateurs autopatrolled] (infini))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module de-links most wikitext.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function delinkReversePipeTrick(s)&lt;br /&gt;
    if s:find('^%[%[|.*[|\n]') or s == '[[|]]' then -- Check for newlines or multiple pipes.&lt;br /&gt;
        return s&lt;br /&gt;
    else&lt;br /&gt;
        return  s:match('%[%[|(.*)%]%]')&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function delinkPipeTrick(s)&lt;br /&gt;
	-- s the tile area, without bracket nor pipe&lt;br /&gt;
    -- We need to deal with colons, brackets, and commas, per [[Help:Pipe trick]].&lt;br /&gt;
    &lt;br /&gt;
    -- First, remove the text before the first colon, if any.&lt;br /&gt;
    s = s:gsub('^(.-:)', '')&lt;br /&gt;
    &lt;br /&gt;
    -- Next up, brackets and commas.&lt;br /&gt;
    if s:find('%(.-%)$') then -- Brackets trump commas.&lt;br /&gt;
        s = s:match('(.-) ?%(.-%)$')&lt;br /&gt;
    elseif s:find(',') then -- If there are no brackets, display only the text before the first comma.&lt;br /&gt;
        s = s:match('(.-),.*$')&lt;br /&gt;
    end&lt;br /&gt;
    return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function delinkWikilink(s)&lt;br /&gt;
	-- s is a string starting with '[[' and ending with ']]'. It does not contain any other ']]' strings.&lt;br /&gt;
	&lt;br /&gt;
	-- Deal with nested links&lt;br /&gt;
	local nested = '[[' .. s:sub(3):gsub('%[%[.-%]%]$', delinkWikilink)&lt;br /&gt;
    if nested ~= s then&lt;br /&gt;
    	return nested&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Deal with the reverse pipe trick.&lt;br /&gt;
    if s:find('^%[%[|') then&lt;br /&gt;
        return delinkReversePipeTrick(s)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Check for bad titles. To do this we need to find the&lt;br /&gt;
    -- title area of the link, i.e. the part before any pipes.&lt;br /&gt;
    local titlearea, display = s:match('^%[%[(.-)|(.*)%]%]$')&lt;br /&gt;
    titlearea = titlearea or s:sub(3, -3)&lt;br /&gt;
    &lt;br /&gt;
    titlearea = mw.uri.decode(titlearea, 'PATH') -- decode percent-encoded entities. Leave underscores and plus signs.&lt;br /&gt;
    titlearea = mw.text.decode(titlearea, true) -- decode HTML entities.&lt;br /&gt;
        &lt;br /&gt;
    local temptitlearea, fragment = titlearea:match('^(.-)#(.*)$')&lt;br /&gt;
    temptitlearea = temptitlearea or titlearea&lt;br /&gt;
    fragment = fragment or ''&lt;br /&gt;
    &lt;br /&gt;
    -- Check for bad characters.&lt;br /&gt;
	if not mw.ustring.isutf8(titlearea)&lt;br /&gt;
		or temptitlearea:find('[%[%]&amp;lt;&amp;gt;|{}%z%c\n]') &lt;br /&gt;
		or temptitlearea:find('%%%x%x')&lt;br /&gt;
		or temptitlearea:find('&amp;amp;..-;') &lt;br /&gt;
		or fragment:find('[%[%]{}%c\n]') &lt;br /&gt;
	then&lt;br /&gt;
    	return s&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    -- Check for categories, interwikis, and files.&lt;br /&gt;
    local colonprefix = titlearea:match('^(.-):') or '' -- Get the text before the first colon.&lt;br /&gt;
    local ns = mw.site.namespaces[colonprefix] -- see if this is a known namespace&lt;br /&gt;
    if mw.language.isKnownLanguageTag(colonprefix)&lt;br /&gt;
    	or ns and (ns.id == 6 or ns.id == 14) &lt;br /&gt;
    then&lt;br /&gt;
        return ''&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Remove the colon if the link is using the [[Help:Colon trick]].&lt;br /&gt;
    if titlearea:sub(1, 1) == ':' then&lt;br /&gt;
        titlearea  = titlearea:sub(2)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Deal with links using the [[Help:Pipe trick]].&lt;br /&gt;
    if display == '' then&lt;br /&gt;
        return delinkPipeTrick(titlearea )&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Find the display area of the wikilink&lt;br /&gt;
    if not display then -- Find if we're dealing with a piped link.&lt;br /&gt;
        -- Remove new lines from the display of multiline piped links,&lt;br /&gt;
        -- where the pipe is before the first new line.&lt;br /&gt;
        titlearea = titlearea:gsub('\n', '')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return display or titlearea &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function delinkURL(s)&lt;br /&gt;
    -- Assume we have already delinked internal wikilinks, and that&lt;br /&gt;
    -- we have been passed some text between two square brackets [foo].&lt;br /&gt;
    &lt;br /&gt;
    -- If the text contains a line break it is not formatted as a URL, regardless of other content.&lt;br /&gt;
    if s:find('\n') then&lt;br /&gt;
        return s&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Check if the text has a valid URL prefix and at least one valid URL character.&lt;br /&gt;
    local valid_url_prefixes =  {'//', 'http://', 'https://', 'ftp://', 'gopher://', 'mailto:', 'news:', 'irc://'}&lt;br /&gt;
    local url_prefix&lt;br /&gt;
    for i,v in ipairs(valid_url_prefixes) do&lt;br /&gt;
        if s:find( '^%[' .. v ..'[^&amp;quot;%s].*%]' ) then&lt;br /&gt;
            url_prefix = v&lt;br /&gt;
            break&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Get display text&lt;br /&gt;
    if not url_prefix then&lt;br /&gt;
    	-- Deal with nested links or send back original string.&lt;br /&gt;
        return &amp;quot;[&amp;quot; .. mw.ustring.gsub( mw.ustring.sub(s, 2), &amp;quot;%[.-%]&amp;quot;, delinkURL )&lt;br /&gt;
    end&lt;br /&gt;
    s = s:match('^%[' .. url_prefix .. '(.*)%]') -- Grab all of the text after the URL prefix and before the final square bracket.&lt;br /&gt;
    s = s:match('^.-([&amp;quot;&amp;lt;&amp;gt; [].*)') or '' -- Grab all of the text after the first URL separator character (&amp;quot;&amp;lt;&amp;gt; ).&lt;br /&gt;
    s = s:match('^%s*(%S.*)$') or '' -- If the separating character was a space, trim it off.&lt;br /&gt;
    &lt;br /&gt;
    local s_decoded = mw.text.decode(s, true)&lt;br /&gt;
    if s_decoded:find('%c') then&lt;br /&gt;
        return s&lt;br /&gt;
    else    &lt;br /&gt;
        return s_decoded&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function p._delink(args)&lt;br /&gt;
    local text = args[1] or ''&lt;br /&gt;
    if args.refs == 'yes' then&lt;br /&gt;
        -- Remove any [[Help:Strip markers]] representing ref tags. In most situations &lt;br /&gt;
        -- this is not a good idea - only use it if you know what you are doing!&lt;br /&gt;
        text = mw.text.unstrip(text)&lt;br /&gt;
    end&lt;br /&gt;
    if not (args.comments == 'no') then&lt;br /&gt;
        text = text:gsub('&amp;lt;!%-%-.-%-%-&amp;gt;', '') -- Remove html comments.&lt;br /&gt;
    end&lt;br /&gt;
    if not (args.wikilinks == 'no') then&lt;br /&gt;
        text = text:gsub('%[%[.-%]%]', delinkWikilink) -- De-link wikilinks.&lt;br /&gt;
    end&lt;br /&gt;
    if not (args.urls == 'no') then&lt;br /&gt;
        text = text:gsub('%[.-%]', delinkURL) -- De-link URLs.&lt;br /&gt;
    end&lt;br /&gt;
    if not (args.whitespace == 'no') then&lt;br /&gt;
        -- Replace single new lines with a single space, but leave double new lines&lt;br /&gt;
        -- and new lines only containing spaces or tabs before a second new line.&lt;br /&gt;
        text = text:gsub('([^\n \t])[ \t]*\n\t*([^\n \t])', '%1 %2')&lt;br /&gt;
        text = text:gsub('\n\t+', '\n') -- Remove leading tab.&lt;br /&gt;
        text = text:gsub('[ \t]+', ' ') -- Remove extra tabs and spaces.&lt;br /&gt;
    end&lt;br /&gt;
    if not (args.nowiki == 'no') then&lt;br /&gt;
    	text = mw.text.unstripNoWiki(text)&lt;br /&gt;
    end&lt;br /&gt;
    return text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.delink(frame)&lt;br /&gt;
    local args&lt;br /&gt;
    if frame == mw.getCurrentFrame() then&lt;br /&gt;
        -- We're being called via #invoke. If the invoking template passed any args, use&lt;br /&gt;
        -- them. Otherwise, use the args that were passed into the template.&lt;br /&gt;
        args = frame:getParent().args&lt;br /&gt;
        for k, v in pairs(frame.args) do&lt;br /&gt;
            args = frame.args&lt;br /&gt;
            break&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        -- We're being called from another module or from the debug console, so assume&lt;br /&gt;
        -- the args are passed in directly.&lt;br /&gt;
        args = frame&lt;br /&gt;
    end&lt;br /&gt;
    return p._delink(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>fr&gt;Jules78120</name></author>
		
	</entry>
</feed>