<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>http://japolitiball.myht.org/index.php?action=history&amp;feed=atom&amp;title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%3ANoredirect</id>
	<title>モジュール:Noredirect - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="http://japolitiball.myht.org/index.php?action=history&amp;feed=atom&amp;title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%3ANoredirect"/>
	<link rel="alternate" type="text/html" href="http://japolitiball.myht.org/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Noredirect&amp;action=history"/>
	<updated>2026-08-07T23:22:59Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>http://japolitiball.myht.org/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Noredirect&amp;diff=82&amp;oldid=prev</id>
		<title>LiberalPolandball: ページの作成:「local p = {}  -- Return a blue noredirect wikilink for an existing page, a red wikilink for a non-existing page function p.noredirect(pagetitle, label)      -- Evaluate pagetitle     if pagetitle == nil or pagetitle == &#039;&#039; then         return error(&#039;ページ名が指定されていません&#039;)     end     pagetitle = pagetitle:gsub(&#039;^%[*&#039;, &#039;&#039;):gsub(&#039;%]*$&#039;, &#039;&#039;) -- Remove leading/trailing brackets to prevent errors     pagetitle = pagetitle:gsub(&#039;_&#039;, &#039; &#039;) -- Replace un…」</title>
		<link rel="alternate" type="text/html" href="http://japolitiball.myht.org/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Noredirect&amp;diff=82&amp;oldid=prev"/>
		<updated>2026-07-13T08:05:12Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「local p = {}  -- Return a blue noredirect wikilink for an existing page, a red wikilink for a non-existing page function p.noredirect(pagetitle, label)      -- Evaluate pagetitle     if pagetitle == nil or pagetitle == &amp;#039;&amp;#039; then         return error(&amp;#039;ページ名が指定されていません&amp;#039;)     end     pagetitle = pagetitle:gsub(&amp;#039;^%[*&amp;#039;, &amp;#039;&amp;#039;):gsub(&amp;#039;%]*$&amp;#039;, &amp;#039;&amp;#039;) -- Remove leading/trailing brackets to prevent errors     pagetitle = pagetitle:gsub(&amp;#039;_&amp;#039;, &amp;#039; &amp;#039;) -- Replace un…」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Return a blue noredirect wikilink for an existing page, a red wikilink for a non-existing page&lt;br /&gt;
function p.noredirect(pagetitle, label)&lt;br /&gt;
&lt;br /&gt;
    -- Evaluate pagetitle&lt;br /&gt;
    if pagetitle == nil or pagetitle == &amp;#039;&amp;#039; then&lt;br /&gt;
        return error(&amp;#039;ページ名が指定されていません&amp;#039;)&lt;br /&gt;
    end&lt;br /&gt;
    pagetitle = pagetitle:gsub(&amp;#039;^%[*&amp;#039;, &amp;#039;&amp;#039;):gsub(&amp;#039;%]*$&amp;#039;, &amp;#039;&amp;#039;) -- Remove leading/trailing brackets to prevent errors&lt;br /&gt;
    pagetitle = pagetitle:gsub(&amp;#039;_&amp;#039;, &amp;#039; &amp;#039;) -- Replace underscores with spaces because this variable will be used for the link&amp;#039;s label&lt;br /&gt;
    pagetitle = pagetitle:gsub(&amp;#039;^%s*&amp;#039;, &amp;#039;&amp;#039;):gsub(&amp;#039;%s*$&amp;#039;, &amp;#039;&amp;#039;) -- trim&lt;br /&gt;
    if pagetitle == &amp;#039;&amp;#039; then&lt;br /&gt;
        return error(&amp;#039;ページ名が不正です&amp;#039;)&lt;br /&gt;
    elseif pagetitle:find(&amp;#039;[&amp;lt;&amp;gt;[%]{}|]&amp;#039;) then&lt;br /&gt;
        return error(&amp;#039;ページ名に使用できない記号が含まれています（ &amp;lt; &amp;gt; [ ] { } | ）&amp;#039;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Create link&lt;br /&gt;
    local title = mw.title.new(pagetitle)&lt;br /&gt;
    if label == nil or label == &amp;#039;&amp;#039; then&lt;br /&gt;
        label = pagetitle -- Don&amp;#039;t use title.prefixedText here because the namespace alias (if the title contains any) is replaced by its canonical one&lt;br /&gt;
    end&lt;br /&gt;
    if title.exists then&lt;br /&gt;
        local link = &amp;#039;[&amp;#039; .. tostring(mw.uri.fullUrl(title.prefixedText, {redirect = &amp;#039;no&amp;#039;})) .. &amp;#039; &amp;#039; .. label .. &amp;#039;]&amp;#039;&lt;br /&gt;
        link = &amp;#039;&amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;&amp;#039; .. link .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
        return link&lt;br /&gt;
    else&lt;br /&gt;
        return &amp;#039;[[:&amp;#039; .. title.prefixedText .. &amp;#039;|&amp;#039; .. label .. &amp;#039;]]&amp;#039;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Main package function&lt;br /&gt;
function p.Main(frame)&lt;br /&gt;
    return p.noredirect(frame.args[&amp;#039;1&amp;#039;], frame.args[&amp;#039;2&amp;#039;])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>LiberalPolandball</name></author>
	</entry>
</feed>