Sync with upstream
starcitizen>Alistair3149 (Created page with "-------------------------------------------------------------------------------- -- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the {{format link}} template. -------------------------------------------------------------------------------- local libraryUtil = require(...") |
starcitizen>Alistair3149 (Sync with upstream) |
||
| Рядок 1: | Рядок 1: | ||
-- Imported from: https://en.wikipedia.org/wiki/Module:Format_link | |||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
-- Format link | -- Format link | ||
| Рядок 72: | Рядок 74: | ||
section = postHash | section = postHash | ||
end | end | ||
return { | return { | ||
link = link, | link = link, | ||
| Рядок 99: | Рядок 101: | ||
mError = require('Module:Error') | mError = require('Module:Error') | ||
return mError.error{message = | return mError.error{message = | ||
'Error: | 'Error: no link or target specified! ([[' .. target .. '#Errors|help]])' | ||
} | } | ||
end | end | ||
| Рядок 175: | Рядок 177: | ||
end | end | ||
end | end | ||
-- Format the result as a link | -- Format the result as a link | ||
if parsed.link == display then | if parsed.link == display then | ||