fbpx
วิกิพีเดีย

มอดูล:Expand wikitext

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

การใช้งาน

{{#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>}} → x-
  • {{#invoke:Expand wikitext|preprocessDecodeUnstrip|<nowiki>{{1x|x}} -</nowiki>}} → x -
  • {{#invoke:Expand wikitext|preprocessDecodeUnstrip|<nowiki><u>underline</u><ref>text</ref></nowiki>}}underline

  1. text
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  -- just in case we need to use {{{unstrip}}} in wikitext -- also this make the code simpler and faster function p.preprocess(frame)  return frame:preprocess(frame.args[1]) end function p.preprocessUnstrip(frame)  return frame:preprocess(mw.text.unstripNoWiki(frame.args[1])) end -- To be invoked directly function p.preprocessDecodeUnstrip(frame)  return frame:preprocess(mw.text.decode(mw.text.unstripNoWiki(frame.args[1])))  -- From experiment in https://th.wikisource.org/wiki/มอดูล:User:Ans/PerformanceTest  -- by function preprocessNowiki2M() vs preprocessNowikiM(),  -- this make code run faster?  --local text = mw.text  --return frame:preprocess(text.decode(text.unstripNoWiki(frame.args[1]))) end -- To be invoked by Template function p.parentPreprocessDecodeUnstrip(frame)  return frame:getParent():preprocess(mw.text.decode(mw.text.unstripNoWiki(frame.args[1]))) end  function p.preprocessDecode(frame)  return frame:preprocess(mw.text.decode(frame.args[1])) end  return p 

มอด, expand, wikitext, อการใช, งานมอด, แก, ประว, างแคช, this, module, rated, ready, general, reached, mature, form, thought, free, ready, wherever, appropriate, ready, mention, help, pages, other, wikipedia, resources, option, users, learn, reduce, server, loa. khumuxkarichnganmxdul du aek prawti langaekhch This module is rated as ready for general use It has reached a mature form and is thought to be bug free and ready for use wherever appropriate It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn To reduce server load and bad output it should be improved by sandbox testing rather than repeated trial and error editing karichngan aekikh invoke Expand wikitext function name twxyang aekikh invoke expand wikitext main lt nowiki gt 1x x lt nowiki gt 1x x invoke expand wikitext main lt nowiki gt 1x x lt nowiki gt x invoke expand wikitext main lt nowiki gt lt u gt u lt u gt lt ref gt text lt ref gt lt nowiki gt lt u gt u lt u gt lt ref gt text lt ref gt invoke Expand wikitext preprocessDecodeUnstrip lt nowiki gt 1x x lt nowiki gt x invoke Expand wikitext preprocessDecodeUnstrip lt nowiki gt 1x x lt nowiki gt x invoke Expand wikitext preprocessDecodeUnstrip lt nowiki gt lt u gt underline lt u gt lt ref gt text lt ref gt lt nowiki gt underline 1 khumuxkarichnganthipraktdanbnnidungmacak mxdul Expand wikitext doc aek prawti phuekhiynsamarththakarthdlxngidthikrabathray srang khdlxk aelachudthdsxb srang khxngmxdulni hnayxykhxngmxdulni textlocal 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 just in case we need to use unstrip in wikitext also this make the code simpler and faster function p preprocess frame return frame preprocess frame args 1 end function p preprocessUnstrip frame return frame preprocess mw text unstripNoWiki frame args 1 end To be invoked directly function p preprocessDecodeUnstrip frame return frame preprocess mw text decode mw text unstripNoWiki frame args 1 From experiment in https th wikisource org wiki mxdul User Ans PerformanceTest by function preprocessNowiki2M vs preprocessNowikiM this make code run faster local text mw text return frame preprocess text decode text unstripNoWiki frame args 1 end To be invoked by Template function p parentPreprocessDecodeUnstrip frame return frame getParent preprocess mw text decode mw text unstripNoWiki frame args 1 end function p preprocessDecode frame return frame preprocess mw text decode frame args 1 end return p ekhathungcak https th wikipedia org w index php title mxdul Expand wikitext amp oldid 9650456, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม