From 69522a194a1e0c9a8263a985782d48fe1cc8690b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 15 Nov 2019 14:58:01 +0800 Subject: =?UTF-8?q?=E4=BC=98=E5=8C=96=20getLinks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/parser/guide.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'server-beta/src/parser') diff --git a/server-beta/src/parser/guide.lua b/server-beta/src/parser/guide.lua index c141feb5..c96f7143 100644 --- a/server-beta/src/parser/guide.lua +++ b/server-beta/src/parser/guide.lua @@ -357,8 +357,16 @@ end --- 获取指定的 special function m.eachSpecialOf(ast, name, callback) - if not ast.special then - + local root = m.getRoot(ast) + if not root.specials then + return + end + local specials = root.specials[name] + if not specials then + return + end + for i = 1, #specials do + callback(specials[i]) end end -- cgit v1.2.3