@@ -144,16 +144,18 @@ end local function checkFromSec(sec,doc) - if sec and not id:find'%.' then - local rid = sec.refs[id] - if rid then - return rid, id, sec + if not id:find'%.' then + if sec then + local rid = sec.refs[id] + if rid then + return rid, id, sec + end end - if doc.sections[rid] then - return nil, id, doc.sections[rid] + if doc.sections[id] then + return nil, id, doc.sections[id] end else local secid, ref = string.match(id, "(.-)%.(.+)") local s @@ -199,9 +201,9 @@ end end end - o,i,s = scanParents(doc) + o,i,s = scanParents(self.doc) if o or s then return o,i,s end self:fail("ID ā€œ%sā€ does not name an object or section", id) end