편집 요약 없음
편집 요약 없음
106번째 줄: 106번째 줄:
else
else
local prevcode = p.prevcode(curr);
local prevcode = p.prevcode(curr);
if args['템플릿'] then
if args['템플릿'] and mw.title.new(mw.uri.encode(prevcode, "WIKI")).exists == false then
                    if mw.title.new(mw.uri.encode(prevcode, "WIKI")).exists then
                     prev = ustring.format('<div class="plainlinks">[https://librewiki.net/index.php?title=%s&action=edit&preload=%s <div>%s<br>→</div>]</div>', mw.uri.encode(prevcode, "WIKI"), mw.uri.encode(args['템플릿'], "WIKI"), p.prevchar(curr))
                        prev = ustring.format('[[%s|<div>%s<br>←</div>]]', prevcode, p.prevchar(curr))   
                     else
                        prev = ustring.format('<div class="plainlinks">[https://librewiki.net/index.php?title=%s&action=edit&preload=%s <div>%s<br>→</div>]</div>', mw.uri.encode(prevcode, "WIKI"), mw.uri.encode(args['템플릿'], "WIKI"), p.prevchar(curr))
                    end
else  
else  
prev = ustring.format('[[%s|<div>%s<br>←</div>]]', prevcode, p.prevchar(curr))
prev = ustring.format('[[%s|<div>%s<br>←</div>]]', prevcode, p.prevchar(curr))
119번째 줄: 115번째 줄:
else
else
local nextcode = p.nextcode(curr);
local nextcode = p.nextcode(curr);
if args['템플릿'] then
if args['템플릿'] and mw.title.new(mw.uri.encode(nextcode, "WIKI")).exists == false then
                    if mw.title.new(mw.uri.encode(nextcode, "WIKI")).exists then
next = ustring.format('<div class="plainlinks">[https://librewiki.net/index.php?title=%s&action=edit&preload=%s <div>%s<br>→</div>]</div>', mw.uri.encode(nextcode, "WIKI"), mw.uri.encode(args['템플릿'], "WIKI"), p.nextchar(curr))
                        next = ustring.format('[[%s|<div>%s<br>→</div>]]', nextcode, p.nextchar(curr))
                    else   
    next = ustring.format('<div class="plainlinks">[https://librewiki.net/index.php?title=%s&action=edit&preload=%s <div>%s<br>→</div>]</div>', mw.uri.encode(nextcode, "WIKI"), mw.uri.encode(args['템플릿'], "WIKI"), p.nextchar(curr))
                    end
else
else
next = ustring.format('[[%s|<div>%s<br>→</div>]]', nextcode, p.nextchar(curr))
next = ustring.format('[[%s|<div>%s<br>→</div>]]', nextcode, p.nextchar(curr))
133번째 줄: 125번째 줄:
else
else
local prevchar = p.prevchar(curr);
local prevchar = p.prevchar(curr);
if args['템플릿'] then
if args['템플릿'] and mw.title.new(prevchar).exists == false then
if mw.title.new(prevchar).exists then
                     prev = ustring.format('<div class="plainlinks">[https://librewiki.net/index.php?title=%s&action=edit&preload=%s <div>%s<br>→</div>]</div>', prevchar, mw.uri.encode(args['템플릿'], "WIKI"), prevchar)
                        prev = ustring.format('[[%s|<div>%s<br>←</div>]]', prevchar, prevchar)
                     else
                        prev = ustring.format('<div class="plainlinks">[https://librewiki.net/index.php?title=%s&action=edit&preload=%s <div>%s<br>→</div>]</div>', prevchar, mw.uri.encode(args['템플릿'], "WIKI"), prevchar)
                    end
else
else
prev = ustring.format('[[%s|<div>%s<br>←</div>]]', prevchar, prevchar)
prev = ustring.format('[[%s|<div>%s<br>←</div>]]', prevchar, prevchar)
146번째 줄: 134번째 줄:
else
else
local nextchar = p.nextchar(curr);
local nextchar = p.nextchar(curr);
if args['템플릿'] then
if args['템플릿'] and mw.title.new(nextchar).exists == false then
if mw.title.new(nextchar).exists then
next = ustring.format('<div class="plainlinks">[https://librewiki.net/index.php?title=%s&action=edit&preload=%s <div>%s<br>→</div>]</div>', nextchar, mw.uri.encode(args['템플릿'], "WIKI"), nextchar)
next = ustring.format('[[%s|<div>%s<br>→</div>]]', nextchar, nextchar)
else
next = ustring.format('<div class="plainlinks">[https://librewiki.net/index.php?title=%s&action=edit&preload=%s <div>%s<br>→</div>]</div>', nextchar, mw.uri.encode(args['템플릿'], "WIKI"), nextchar)
end
else
else
next = ustring.format('[[%s|<div>%s<br>→</div>]]', nextchar, nextchar)
next = ustring.format('[[%s|<div>%s<br>→</div>]]', nextchar, nextchar)