Qiuwen:格式手册/Lua:修订间差异

求闻百科,共笔求闻
添加的内容 删除的内容
无编辑摘要
无编辑摘要
第47行: 第47行:
能直接使用<code>frame:callParserFunction</code>或<code>frame:extensionTag</code>的(以及某些情况确实需要调用<code>frame:expandTemplate</code>的),就不要使用<code>frame:preprocess</code>。
能直接使用<code>frame:callParserFunction</code>或<code>frame:extensionTag</code>的(以及某些情况确实需要调用<code>frame:expandTemplate</code>的),就不要使用<code>frame:preprocess</code>。


能使用<code>mw</code>库中的函数解决的,就避免去调用解析器函数。例如,已经有<code>tostring(mw.title.getCurrentTitle)</code>,就不要去使用<code>frame:callParserFunction('FULLPAGENAME')</code>,更不要使用<code>frame:preprocess '{<nowiki />{FULLPAGENAME}}'</code>。
能使用<code>mw</code>库中的函数解决的,就避免去调用解析器函数。例如,已经有<code>tostring(mw.title.getCurrentTitle())</code>,就不要去使用<code>frame:callParserFunction('FULLPAGENAME')</code>,更不要使用<code>frame:preprocess '{<nowiki />{FULLPAGENAME}}'</code>。


=== 严禁频繁连接字符串 ===
=== 严禁频繁连接字符串 ===