return string.format( "redirects to %s", title.redirectTarget.prefixedText )
else
return "not a redirect"
end
end
return p
!! endarticle
!! article
Module:Test2
!! text
return {
countBeans = function ()
return 3
end
}
!! endarticle
!! article
Module:Metatables
!! text
local p, mt1, mt2 = {}, {}, {}
mt1.__index = {}
function p.zero(frame)
return 'You called the zero method from p'
end
function mt1.__index.one(frame)
return 'You called the one method from mt1'
end
function mt2.__index(t, k)
return function(frame)
return 'You called the ' .. k .. ' method from mt2'
end
end
setmetatable(mt1.__index, mt2)
setmetatable(p, mt1)
return p
!! endarticle
!! article
Module:Redirected
!! text
return require [[Module:Test]]
!! endarticle
!! article
Module:Test "with" quotes
!! text
return require [[Module:Test]]
!! endarticle
!! article
Module:Redirected "with" quotes
!! text
return require [[Module:Test "with" quotes]]
!! endarticle
!! article
Template:Scribunto_all_args
!! text
{{#invoke:test|getParentArgs}}
!! endarticle
!! article
Template:Scribunto_template_with_headers
!! text
== bar ==
!! endarticle
!! article
Template:Scribunto_frame_caching
!! text
{{#invoke:test|testFrameCaching}}
!! endarticle
!! test
Scribunto: no such module
!! options
parsoid={ "modes": ["wt2html","wt2wt"] }
cat
extension=ScribuntoErrors-af3e8c22
!! wikitext
{{#invoke:foo|bar}}
!! metadata
cat=Pages_with_script_errors sort=
extension[ScribuntoErrors-af3e8c22]="<p>Script error: No such module \"foo\".</p><p>No details about the code location available.</p>"
!! html/php
<p><strong class="error"><span class="scribunto-error mw-scribunto-error-af3e8c22">Script error: No such module "foo".</span></strong>
</p>
!! html/parsoid
<p><strong class="error" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"#invoke:foo","function":"invoke"},"params":{"1":{"wt":"bar"}},"i":0}}]}'><span class="scribunto-error mw-scribunto-error-af3e8c22">Script error: No such module <span typeof="mw:Entity">"</span>foo<span typeof="mw:Entity">"</span>.</span></strong></p>
!! end
!! test
Scribunto: no such function
!! options
parsoid={ "modes": ["wt2html","wt2wt"] }
cat
extension=ScribuntoErrors-dcf21d8d
!! wikitext
{{#invoke:test|blah}}
!! metadata
cat=Pages_with_script_errors sort=
extension[ScribuntoErrors-dcf21d8d]="<p>Script error: The function \"blah\" does not exist.</p><p>No details about the code location available.</p>"
!! html/php
<p><strong class="error"><span class="scribunto-error mw-scribunto-error-dcf21d8d">Script error: The function "blah" does not exist.</span></strong>
</p>
!! html/parsoid
<p><strong class="error" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"#invoke:test","function":"invoke"},"params":{"1":{"wt":"blah"}},"i":0}}]}'><span class="scribunto-error mw-scribunto-error-dcf21d8d">Script error: The function <span typeof="mw:Entity">"</span>blah<span typeof="mw:Entity">"</span> does not exist.</span></strong></p>