Diferencia entre revisiones de «Módulo:Formato texto»

Contenido eliminado Contenido añadido
Sin resumen de edición
Sin resumen de edición
Línea 100:
function z.enlazar2(enlace, opciones)
if enlace then
local prefix, etiqueta, namespace, tamano, borde, enlace2, pieImagen, calificativo, debeExistir
 
if type(opciones) == 'table' then
Línea 111:
pieImagen = opciones['pie']
debeExistir = opciones['debe existir'] or opciones['debeExistir'] or opciones['debeexistir']
prefix = (function()
if opciones['solotexto'] then return ':' end
return ''
end)()
elseif type(opciones) == 'string' then
etiqueta = opciones
Línea 126 ⟶ 132:
local resultado = {}
table.insert(resultado, tituloObj.fullText)
if namespace == 14 and opciones['no categorizar'] then
table.insert(resultado, ':' .. tituloObj.fullText)
else
table.insert(resultado, tituloObj.fullText)
end
 
if not debeExistir and namespace ~= 6 then
if etiqueta then table.insert(resultado, etiqueta) end
if calificativo then return '[[' .. prefix .. table.concat(resultado, '|') .. ']]' .. ' <small>(' .. calificativo .. ')</small>' end end
return '[[' .. table.concat(resultado, '|') .. ']]'
end
Línea 146 ⟶ 148:
if etiqueta then table.insert(resultado, etiqueta) end
if pieImagen then return '[[' .. table.concat(resultado, '|') .. ']]' .. '<br>' .. pieImagen end
return '[[' .. prefix .. table.concat(resultado, '|') .. ']]'
end
 
if calificativo then return '[[' .. table.concat(resultado, '|') .. ']]' .. ' <small>(' .. calificativo .. ')</small>' end
return '[[' .. prefix .. table.concat(resultado, '|') .. ']]'
end