Przejdź do zawartości

Moduł:Sandbox/Draco flavus/TestPreprocessSection

Z Wikiźródeł, wolnej biblioteki

Dokumentacja dla tego modułu może zostać utworzona pod nazwą Moduł:Sandbox/Draco flavus/TestPreprocessSection/opis

local p = {}
function p.CopyAllExpand(frame)

-- Wywołanie: {{#invoke: Sandbox/Draco flavus/TestPreprocessSection | CopyAllExpand | Strona:Tadeusz Dołęga-Mostowicz - Ostatnia brygada.djvu/27|begin|end}}
-- Wynik: To samo ale zaktualizowane.
-- 

    local SubPageResult = ""
    local SubPageWhole = ""
    local SubPageName = frame.args[1]
-- Należy podmienić elementy np. PRZYPISY tak/nie, zakresy stron ?

    SubPageWhole=mw.title.new(SubPageName):getContent()
    -- SubPageResult=mw.title.new(SubPageName):getContent()
    if string.len(frame.args[2]) ~= 0 then
    	SubPageWhole=string.gsub(SubPageWhole, ".-" .. frame.args[2] .. ".-\n", "", 1)
    end
    if string.len(frame.args[3]) ~= 0 then
    	SubPageWhole=string.gsub(SubPageWhole, "[^\n]*" .. frame.args[3] .. ".*", "\n", 1)
    end
    SubPageResult=frame:preprocess(SubPageWhole)
    
	return SubPageResult
	
end

return p