Jump to content

Module:Sandbox/KEmel49

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by KEmel49 (talk | contribs) at 06:03, 5 July 2025 (test). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

-- This is an user sandbox, other editor are mostly not welcome
-- If any error exist or any inconsistency exist
-- Do not edit in such case, contact at talk page: [[User talk:KEmel49]]
-- any edit or nomination for deletion is not welcome, it is a Sandbox
-- This module may be moved to new module name after leaving a redirect
-- Then again testing will continue to this module Sandbox
-- Sometime more than one editor will continue editing this sandbox
-- In that case, add all code below notify function.
-- Thank you for your understanding
local p = {}

function p.hello(frame)
	if frame.args[1] == nil then
		return "[[Module:Sandbox/KEmel49]]"
	elseif frame.args[1] then
		return '[[Module:'..frame.args[1]..']]'
    end
end

function p.notify(frame)
	local args = frame.args
	local article = args.article or ""
	local diff = args.diff or ""
	local cite_format = args["cite_format"] or ""
	local ogurl = args.ogurl or ""
	local username = mw.title.getCurrentTitle().text

	local out = {}

	table.insert(out, "== Re: " .. article .. " ==\n\n")

	table.insert(out, '[[File:Information.svg|20px]] Hello ' .. username .. ', This is to let you know that ')
	if diff ~= "" then
		table.insert(out, '[[Special:Diff/' .. diff .. '|one of your recent edits]]')
	else
		table.insert(out, 'one of your recent edits')
	end

	table.insert(out, ' at \'\'[[' .. article .. ']]\'\' caused a citation error. ')

	if cite_format ~= "" then
		table.insert(out, 'you have added invalid url at {{Tl|' .. cite_format .. '}} template. ')
	end

	if ogurl ~= "" then
		table.insert(out, 'Your url input was <code>' .. mw.text.nowiki(ogurl) .. '</code>. ')
	end

	table.insert(out, 'Do not add invalid URLs and use preview before saving your edit. Happy editing.')

	table.insert(out, ' <!-- User:KEmel49/sandbox 5 -->')

	return table.concat(out)
end
-- Edit your testing below this comment

return p