Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:PageLinks/testcases

From Wikipedia, the free encyclopedia
local p = require('Module:UnitTests')

function p:test_basic()
    self:preprocess_equals('{{#invoke:PageLinks | main | t | page=Example }}', '<span>[[:Example|Example]]&nbsp;<span class="plainlinks lx">([[Talk:Example|talk]])</span></span>')
end

function p:test_category()
    self:preprocess_equals('{{#invoke:PageLinks | main | t | page=Category:Example }}', '<span>[[:Category:Example|Category:Example]]&nbsp;<span class="plainlinks lx">([[Category talk:Example|talk]])</span></span>')
end

function p:test_talk()
    self:preprocess_equals('{{#invoke:PageLinks | single | t | page=Example }}', '[[Talk:Example|talk]]')
end

function p:test_views()
    self:preprocess_equals('{{#invoke:PageLinks | single | vlm-sgs | page=Example }}', '[https://pageviews.toolforge.org/?start=2025-09-22&end=2025-11-21&project=en.wikipedia.org&pages=Example stats]')
end

function p:test_logs()
    self:preprocess_equals('{{#invoke:PageLinks | single | tl | page=Sylven Landesberg }}', '[//en.wikipedia.org/w/index.php?title=Special%3ALog&page=Sylven+Landesberg logs]')
end

return p