<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wikiromandie.org/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://wikiromandie.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ADelink"/>
	<link rel="alternate" type="text/html" href="https://wikiromandie.org/index.php?title=Module:Delink&amp;action=history"/>
	<updated>2026-05-11T11:57:10Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wikiromandie.org/index.php?title=Module:Delink&amp;diff=15739&amp;oldid=prev</id>
		<title>Stefannein : 1 version importée</title>
		<link rel="alternate" type="text/html" href="https://wikiromandie.org/index.php?title=Module:Delink&amp;diff=15739&amp;oldid=prev"/>
		<updated>2025-08-20T17:01:56Z</updated>

		<summary type="html">&lt;p&gt;1 version importée&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;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 20 août 2025 à 19:01&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&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;!-- diff cache key mariadb:diff:1.41:old-15738:rev-15739 --&gt;
&lt;/table&gt;</summary>
		<author><name>Stefannein</name></author>
	</entry>
	<entry>
		<id>https://wikiromandie.org/index.php?title=Module:Delink&amp;diff=15738&amp;oldid=prev</id>
		<title>wikipedia&gt;Od1n : uniformisation indentation, trim trailing spaces, quelques nitpicks espaces</title>
		<link rel="alternate" type="text/html" href="https://wikiromandie.org/index.php?title=Module:Delink&amp;diff=15738&amp;oldid=prev"/>
		<updated>2023-03-02T00:11:28Z</updated>

		<summary type="html">&lt;p&gt;uniformisation indentation, trim trailing spaces, quelques nitpicks espaces&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(&amp;#039;^%[%[|.*[|\n]&amp;#039;) or s == &amp;#039;[[|]]&amp;#039; then -- Check for newlines or multiple pipes.&lt;br /&gt;
        return s&lt;br /&gt;
    else&lt;br /&gt;
        return s:match(&amp;#039;%[%[|(.*)%]%]&amp;#039;)&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(&amp;#039;^(.-:)&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
    -- Next up, brackets and commas.&lt;br /&gt;
    if s:find(&amp;#039;%(.-%)$&amp;#039;) then -- Brackets trump commas.&lt;br /&gt;
        s = s:match(&amp;#039;(.-) ?%(.-%)$&amp;#039;)&lt;br /&gt;
    elseif s:find(&amp;#039;,&amp;#039;) then -- If there are no brackets, display only the text before the first comma.&lt;br /&gt;
        s = s:match(&amp;#039;(.-),.*$&amp;#039;)&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 &amp;#039;[[&amp;#039; and ending with &amp;#039;]]&amp;#039;. It does not contain any other &amp;#039;]]&amp;#039; strings.&lt;br /&gt;
&lt;br /&gt;
    -- Deal with nested links&lt;br /&gt;
    local nested = &amp;#039;[[&amp;#039; .. s:sub(3):gsub(&amp;#039;%[%[.-%]%]$&amp;#039;, 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(&amp;#039;^%[%[|&amp;#039;) 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(&amp;#039;^%[%[(.-)|(.*)%]%]$&amp;#039;)&lt;br /&gt;
    titlearea = titlearea or s:sub(3, -3)&lt;br /&gt;
&lt;br /&gt;
    titlearea = mw.uri.decode(titlearea, &amp;#039;PATH&amp;#039;) -- 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(&amp;#039;^(.-)#(.*)$&amp;#039;)&lt;br /&gt;
    temptitlearea = temptitlearea or titlearea&lt;br /&gt;
    fragment = fragment or &amp;#039;&amp;#039;&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;#039;[%[%]&amp;lt;&amp;gt;|{}%z%c\n]&amp;#039;)&lt;br /&gt;
        or temptitlearea:find(&amp;#039;%%%x%x&amp;#039;)&lt;br /&gt;
        or temptitlearea:find(&amp;#039;&amp;amp;..-;&amp;#039;)&lt;br /&gt;
        or fragment:find(&amp;#039;[%[%]{}%c\n]&amp;#039;)&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(&amp;#039;^(.-):&amp;#039;) or &amp;#039;&amp;#039; -- 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 &amp;#039;&amp;#039;&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) == &amp;#039;:&amp;#039; 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 == &amp;#039;&amp;#039; 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&amp;#039;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(&amp;#039;\n&amp;#039;, &amp;#039;&amp;#039;)&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(&amp;#039;\n&amp;#039;) 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 = {&amp;#039;//&amp;#039;, &amp;#039;http://&amp;#039;, &amp;#039;https://&amp;#039;, &amp;#039;ftp://&amp;#039;, &amp;#039;gopher://&amp;#039;, &amp;#039;mailto:&amp;#039;, &amp;#039;news:&amp;#039;, &amp;#039;irc://&amp;#039;}&lt;br /&gt;
    local url_prefix&lt;br /&gt;
    for i,v in ipairs(valid_url_prefixes) do&lt;br /&gt;
        if s:find( &amp;#039;^%[&amp;#039; .. v ..&amp;#039;[^&amp;quot;%s].*%]&amp;#039; ) 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(&amp;#039;^%[&amp;#039; .. url_prefix .. &amp;#039;(.*)%]&amp;#039;) -- Grab all of the text after the URL prefix and before the final square bracket.&lt;br /&gt;
    s = s:match(&amp;#039;^.-([&amp;quot;&amp;lt;&amp;gt; [].*)&amp;#039;) or &amp;#039;&amp;#039; -- Grab all of the text after the first URL separator character (&amp;quot;&amp;lt;&amp;gt; ).&lt;br /&gt;
    s = s:match(&amp;#039;^%s*(%S.*)$&amp;#039;) or &amp;#039;&amp;#039; -- 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(&amp;#039;%c&amp;#039;) 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 &amp;#039;&amp;#039;&lt;br /&gt;
    if args.refs == &amp;#039;yes&amp;#039; 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 == &amp;#039;no&amp;#039;) then&lt;br /&gt;
        text = text:gsub(&amp;#039;&amp;lt;!%-%-.-%-%-&amp;gt;&amp;#039;, &amp;#039;&amp;#039;) -- Remove html comments.&lt;br /&gt;
    end&lt;br /&gt;
    if not (args.wikilinks == &amp;#039;no&amp;#039;) then&lt;br /&gt;
        text = text:gsub(&amp;#039;%[%[.-%]%]&amp;#039;, delinkWikilink) -- De-link wikilinks.&lt;br /&gt;
    end&lt;br /&gt;
    if not (args.urls == &amp;#039;no&amp;#039;) then&lt;br /&gt;
        text = text:gsub(&amp;#039;%[.-%]&amp;#039;, delinkURL) -- De-link URLs.&lt;br /&gt;
    end&lt;br /&gt;
    if not (args.whitespace == &amp;#039;no&amp;#039;) 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(&amp;#039;([^\n \t])[ \t]*\n\t*([^\n \t])&amp;#039;, &amp;#039;%1 %2&amp;#039;)&lt;br /&gt;
        text = text:gsub(&amp;#039;\n\t+&amp;#039;, &amp;#039;\n&amp;#039;) -- Remove leading tab.&lt;br /&gt;
        text = text:gsub(&amp;#039;[ \t]+&amp;#039;, &amp;#039; &amp;#039;) -- Remove extra tabs and spaces.&lt;br /&gt;
    end&lt;br /&gt;
    if not (args.nowiki == &amp;#039;no&amp;#039;) 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&amp;#039;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&amp;#039;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>wikipedia&gt;Od1n</name></author>
	</entry>
</feed>