From af68f61c509cba767975ba8e6eae8231efd19044 Mon Sep 17 00:00:00 2001 From: mpeterv Date: Thu, 10 Sep 2015 22:15:42 +0300 Subject: [PATCH] Make the module and the tests Lua 5.3 compatible --- markdown-tests.lua | 4 ++-- markdown.lua | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/markdown-tests.lua b/markdown-tests.lua index fff1499..187fe90 100644 --- a/markdown-tests.lua +++ b/markdown-tests.lua @@ -4401,10 +4401,10 @@ local function run_tests() -- Do any
 sequences in s1 and s2 match up perfectly?
    local function pre_equal(s1, s2)
       local pre = {}
-      for p in s1:gfind("
.-
") do + for p in s1:gmatch("
.-
") do pre[#pre+1] = p end - for p in s2:gfind("
.-
") do + for p in s2:gmatch("
.-
") do if p ~= pre[1] then return false end table.remove(pre, 1) end diff --git a/markdown.lua b/markdown.lua index 2de8b09..77aaaeb 100644 --- a/markdown.lua +++ b/markdown.lua @@ -120,6 +120,8 @@ THE SOFTWARE. -- Utility functions ---------------------------------------------------------------------- +local unpack = table.unpack or unpack + -- Locks table t from changes, writes an error if someone attempts to change the table. -- This is useful for detecting variables that have "accidently" been made global. Something -- I tend to do all too much.