WLink – Module with functions for strings in context of wikilinks and external links (URL). This module was imported from de:Module:WLink.
| This Lua module is used on approximately 9,200 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
WLink – Module with functions for strings in context of wikilinks and external links (URL). This module was imported from de:Module:WLink.
All functions expect exactly one unnamed parameter (which should be provided to get a meaningful answer). Whitespace ahead and after content is ignored. HTML Entities would not disturb syntax and might be resolved. The parameter might contain single or double bracketed links which would be extracted if appropriate.
The return value is an empty string (“nothing”), if the parameter value does not fulfil the expectations. If there is a result or the query condition is true, at least one visible character will be returned. The result does not begin or end with a space.
space – encoding of spaces:
space=+ – common for query componentsspace=_ – as for Wikis%20#2016-10-051 – required version
A test page illustrates practical use.
All functions described above can be used by other modules:
local lucky, WLink = pcall( require, "Module:WLink" )
if type( WLink ) == "table" then
WLink = WLink.WLink()
else
-- failure; WLink is the error message
return "<span class=\"error\">" .. WLink .. "</span>"
end
Subsequently there are available:
false, if not found; but empty string if empty fragment.# in result.false.lead – leading colon : present and required, if trueproject – project interwiki within wikifarm (recommendable brief notation)lang – known language version (downcased)ns – number of namespacespace – local canonical name of namespacetitle – page title as provided; at least empty stringIf succeeding, the WLink.get*() return a string, the WLink.is*() true (if no exception mentioned); on failure always false.
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.