« Module:Version imprimable » : différence entre les versions

Contenu supprimé Contenu ajouté
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 48 :
PageName = mw.ustring.gsub(chapter, "[^"..sep.."]*"..sep.."*(.*)", "%1")
if (PageName ~= nil and PageName ~= '') then
if Break ~= "" then table.insert(PrintVersion, frame:expandTemplate{title = Break}) end
table..insert(PrintVersion, '\n<div style="clear:both;"></div>\n=' .. PageName .. '=\n')
end
table.insert(PrintVersion, frame:expandTemplate{ title = ':' .. chapter } .. '\n\n')
Ligne 88 ⟶ 89 :
 
chapter = mw.ustring.gsub(chapter, "{{BOOKNAME}}", BookName)
chapter = mw.ustring.gsub(chapter, "{{Modulo%|([^}]+)}}", "[[%1]]")
chapter = mw.ustring.gsub(chapter, "{{[^}]*}}", "")
chapter = mw.ustring.gsub(chapter, "^[%#%*: ]*", "")
Ligne 106 ⟶ 108 :
if OnlySubpages then
-- Book subpages only (and ignoring the other links like "see also")
if mw.text.truncate(chapter, mw.ustringstring.len(BookName .. sep)) ~= (BookName .. sep .. "…") and mw.text.truncate(chapter, mw.ustringstring.len(BookName .. sep)) ~= (BookName .. sep .. "...") then
if debug then chapter = '<font color=red>No book subpage into the internal link:</font> ' .. mw.text.truncate(chapter, mw.ustringstring.len(BookName .. sep)) .. " ~= " .. BookName .. sep .. "…" else chapter = '' end
end
end