Diferencia entre revisiones de «Módulo:Encabezado»
Contenido eliminado Contenido añadido
Sin resumen de edición |
Sin resumen de edición |
||
Línea 9:
local altparams= {['titulo']='título', ['title']='título', ['left']='anterior', ['right']='próximo', ['author']='autor', ['traducción']='traductor' }
local function enlaceMicroformato(param, valor)▼
local function link(s)
return mw.html.create('span')▼
if s:match("%[") then
:addClass('ws-' .. param)▼
:wikitext(valor) ▼
return '[['..s..']]'
end
local function delink(s)
Línea 22 ⟶ 25:
result = mw.uri.decode(result, "PATH") -- decode percent-encoded entities. Leave underscores and plus signs.
result = mw.text.decode(result, true) -- decode HTML entities.
▲ else
▲ end
▲ return s
end▼
-- Remove the colon if the link is using the [[Help:Colon trick]].
if result:match("%[%[:") then
result = "[[" .. result:match("%[%[:(.*%]%])")
end
-- Find the display area of the wikilink
if result:match("|") then -- Find if we're dealing with a piped link.
result = result:match("^%[%[
-- Remove new lines from the display of multiline piped links,
-- where the pipe is before the first new line.
Línea 80 ⟶ 55:
return texto
end
▲local function enlaceMicroformato(param, valor)
▲ return mw.html.create('span')
▲ :addClass('ws-' .. param)
▲ :wikitext(delink(valor))
function p.encabe( frame )
local argus = {}
Línea 137 ⟶ 116:
for _,v in ipairs(mw.text.split(argus['autor'], '[/,]')) do
i = i-1
medio:wikitext(
if i >0 then medio:wikitext(', ') end
end
Línea 146 ⟶ 125:
medio:wikitext('traducción de [[Ayuda:Directrices para traducciones|Wikisource]]')
else
medio:wikitext('traduccion de
end
medio:tag('br')
Línea 152 ⟶ 131:
end
if argus['ilustrador'] then
medio:wikitext('ilustración de
medio:tag('br')
end
Línea 162 ⟶ 141:
medio:wikitext(argus['sección'])
if argus['sección autor'] then
medio:wikitext(' de
end
if argus['subsección'] then
|