ผลต่างระหว่างรุ่นของ "มอดูล:Expand wikitext"

เนื้อหาที่ลบ เนื้อหาที่เพิ่ม
Horus (คุย | ส่วนร่วม)
หน้าใหม่: local p = {} local yesno = require("Module:Yesno") function p.main(frame) local pframe = frame:getParent() local code = frame.args[1] if mw.text.trim(mw.text.killMark...
(ไม่แตกต่าง)

รุ่นแก้ไขเมื่อ 20:21, 9 สิงหาคม 2563

Documentation icon คู่มือการใช้งานมอดูล[ดู] [แก้] [ประวัติ] [ล้างแคช]

การใช้งาน

{{#invoke:Expand wikitext|function_name}}

ตัวอย่าง

  • {{#invoke:expand wikitext|main|<nowiki>{{1x|x}}-</nowiki>}} → {{1x|x}}-
  • {{#invoke:expand wikitext|main|<nowiki>{{1x|x}} -</nowiki>}} → x -
  • {{#invoke:expand wikitext|main|<nowiki><u>u</u><ref>text</ref></nowiki>}} → <u>u</u><ref>text</ref>
  • {{#invoke:Expand wikitext|preprocessDecodeUnstrip|<nowiki>{{1x|x}}-</nowiki>}}ข้อผิดพลาดสคริปต์: ฟังก์ชัน "preprocessDecodeUnstrip" ไม่มีอยู่
  • {{#invoke:Expand wikitext|preprocessDecodeUnstrip|<nowiki>{{1x|x}} -</nowiki>}}ข้อผิดพลาดสคริปต์: ฟังก์ชัน "preprocessDecodeUnstrip" ไม่มีอยู่
  • {{#invoke:Expand wikitext|preprocessDecodeUnstrip|<nowiki><u>underline</u><ref>text</ref></nowiki>}}ข้อผิดพลาดสคริปต์: ฟังก์ชัน "preprocessDecodeUnstrip" ไม่มีอยู่

local p = {}
local yesno = require("Module:Yesno")
function p.main(frame)
	local pframe = frame:getParent()
	local code = frame.args[1]
	if mw.text.trim(mw.text.killMarkers(code)) == "" or yesno(frame.args.unstrip) then
		code = mw.text.unstripNoWiki(code);
	end
	return pframe:preprocess(code)
end

return p