diff options
author | Hans Hagen <pragma@wxs.nl> | 2013-06-04 19:42:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2013-06-04 19:42:00 +0200 |
commit | fb6533c362f27e9811417482f57ea8cbdd31abf0 (patch) | |
tree | 1f97acb4bbbb3777738581c89e7211b0664f678a /tex/context/base/strc-mar.lua | |
parent | f7eaca8dd3301d6526d1610e523d6538404dc95b (diff) | |
download | context-fb6533c362f27e9811417482f57ea8cbdd31abf0.tar.gz |
beta 2013.06.04 19:42
Diffstat (limited to 'tex/context/base/strc-mar.lua')
-rw-r--r-- | tex/context/base/strc-mar.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tex/context/base/strc-mar.lua b/tex/context/base/strc-mar.lua index 7b3ac11e1..26603fe72 100644 --- a/tex/context/base/strc-mar.lua +++ b/tex/context/base/strc-mar.lua @@ -12,7 +12,9 @@ if not modules then modules = { } end modules ['strc-mar'] = { local insert, concat = table.insert, table.concat local tostring, next, rawget = tostring, next, rawget local lpegmatch = lpeg.match -local match = string.match + +local context = context +local commands = commands local allocate = utilities.storage.allocate local setmetatableindex = table.setmetatableindex @@ -121,7 +123,7 @@ local function sweep(head,first,last) end local list = n.list if list then - first, last = sweep(list, first, last) + first, last = sweep(list,first,last) end end end @@ -659,8 +661,10 @@ function marks.fetchallmarks(name,range) fetchallmarks(name,range ) -- here we have a few helpers .. will become commands.* +local pattern = lpeg.afterprefix("li::") + function marks.title(tag,n) - local listindex = match(n,"^li::(.-)$") + local listindex = lpegmatch(pattern,n) if listindex then commands.savedlisttitle(tag,listindex,"marking") else @@ -669,7 +673,7 @@ function marks.title(tag,n) end function marks.number(tag,n) -- no spec - local listindex = match(n,"^li::(.-)$") + local listindex = lpegmatch(pattern,n) if listindex then commands.savedlistnumber(tag,listindex) else |