Zelda110(留言 | 贡献)2025年12月21日 (日) 17:12的版本 (创建页面,内容为“local p = {} -- 辅助函数:只移除不必要的干扰项(如模板、注释、引文),保留链接和加粗 local function cleanWikitextForDisplay(text) if not text then return "" end -- 1. 移除 <ref> 及其内容(避免摘要里出现 [1][2] 或引文列表) text = string.gsub(text, "<ref.-</ref>", "") text = string.gsub(text, "<ref.->", "") -- 2. 移除 HTML 注释 text = string.gsub(text, "<!%-%-.-%-%->", "…”)