function Pandoc(doc) -- This function will process the entire document for _, el in pairs(doc.blocks) do if el.t == "Para" then for _, inline in pairs(el.content) do if inline.t == "Str" and inline.text:match("%[@%a+%]") then -- This is a simple detection for semantic annotations print("Found semantic annotation: " .. inline.text) end end end end return doc end