Skip to content

Commit f29f043

Browse files
committed
Fixes #1846: bring back virtual pages
Was misusing Lua pattern matching before
1 parent 0f3f963 commit f29f043

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/Library/Std/APIs/Virtual Page.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ event.listen {
4242
run = function(e)
4343
local pageName = e.data.name
4444
for _, def in pairs(config.get("virtualPages")) do
45-
local match = table.pack(pageName:match(def.pattern))
46-
if not(#match == 1 and match[1] == nil) then
45+
local match = pageName:match(def.pattern)
46+
if match != nil then
4747
-- we got an actual match
4848
return {
49-
text = def.run(table.unpack(match)),
49+
text = def.run(match),
5050
perm = "ro"
5151
}
5252
end

0 commit comments

Comments
 (0)