diff options
Diffstat (limited to 'tex/context/base/strc-tag.lua')
-rw-r--r-- | tex/context/base/strc-tag.lua | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/tex/context/base/strc-tag.lua b/tex/context/base/strc-tag.lua index 20da7782d..a0c1d1d32 100644 --- a/tex/context/base/strc-tag.lua +++ b/tex/context/base/strc-tag.lua @@ -175,18 +175,24 @@ function tags.detailedtag(tag,detail,attribute) if not attribute then attribute = texattribute[a_tagged] end - local tl = taglist[attribute] - local pattern - if detail and detail ~= "" then - pattern = "^" .. tag .. ":".. detail .. "%-" - else - pattern = "^" .. tag .. "%-" - end - for i=#tl,1,-1 do - local tli = tl[i] - if find(tli,pattern) then - return tli + if attribute >= 0 then + local tl = taglist[attribute] + if tl then + local pattern + if detail and detail ~= "" then + pattern = "^" .. tag .. ":".. detail .. "%-" + else + pattern = "^" .. tag .. "%-" + end + for i=#tl,1,-1 do + local tli = tl[i] + if find(tli,pattern) then + return tli + end + end end + else + -- enabled but not auto end return false -- handy as bogus index end |