Diferencia entre revisiones de «Módulo:Excerpt»
Contenido eliminado Contenido añadido
Bugfix |
Simplificando, el sistema MediaWiki no permite espacios al inicio de las etiquetas |
||
Línea 546:
end
if not is(options.keepRefs) then
text = mw.ustring.gsub(text, "<
text = mw.ustring.gsub(text, "<
text = mw.ustring.gsub(text, "%b{}", stripTemplate) -- remove unwanted templates such as references
end
text = mw.ustring.gsub(text, "<
text = mw.ustring.gsub(text, "<
text = mw.ustring.gsub(text, "%s*{{%s*[Tt][Oo][Cc].-}}", "") -- remove most common tables of contents
text = mw.ustring.gsub(text, "%s*__[A-Z]*TOC__", "") -- remove TOC behavior switches
Línea 590:
local function fixTags(text, tag)
local startCount = 0
for i in mw.ustring.gmatch(text, "<
local endCount = 0
for i in mw.ustring.gmatch(text, "<
if startCount > endCount then -- more <tag> than </tag>: remove the last few <tag>s
local i = 0
text = mw.ustring.gsub(text, "<
i = i + 1
if i > endCount then return "" else return nil end
end) -- "end" here terminates the anonymous replacement function(t) passed to gsub
elseif endCount > startCount then -- more </tag> than <tag>: remove the first few </tag>s
text = mw.ustring.gsub(text, "<
end
return text
Línea 647:
end
while position < mw.ustring.len(text) do
refName, position = mw.ustring.match(text, "<
if refName then
refName = mw.text.trim(refName)
Línea 653:
table.insert(refNames, refName)
refName = escapeSpecialChars(refName)
refBody = mw.ustring.match(text, "<
if not refBody then -- the ref body is not in the excerpt
refBody = mw.ustring.match(full, "<
if refBody then -- the ref body was found elsewhere
text = mw.ustring.gsub(text, "<
end
end
Línea 665:
end
end
text = mw.ustring.gsub(text, "<
text = mw.ustring.gsub(text, "<
return text
end
|