Modül:GununMaddesi

Hukukipedia sitesinden
Gezinti kısmına atla Arama kısmına atla

Bu modül için bir Modül:GununMaddesi/belge belgelendirmesi oluşturabilirsiniz

local p = {}

function p.extract(frame)
    local title = mw.title.new(frame.args[1])
    if not title or not title.exists then
        return "<i>Madde bulunamadı.</i>"
    end

    local content = title:getContent() or ""
    local firstPara = content:match("^(.-)\n\n") or content

    -- nowiki kalıntılarını temizle
    firstPara = firstPara:gsub("__NOTOC__", "")
    firstPara = firstPara:gsub("__NOEDITSECTION__", "")

    return firstPara
end

return p