summaryrefslogtreecommitdiff
path: root/rst_context.lua
diff options
context:
space:
mode:
Diffstat (limited to 'rst_context.lua')
-rw-r--r--rst_context.lua20
1 files changed, 6 insertions, 14 deletions
diff --git a/rst_context.lua b/rst_context.lua
index 80bbd3b..f0fae72 100644
--- a/rst_context.lua
+++ b/rst_context.lua
@@ -594,41 +594,33 @@ local function parse_itemstring(str)
if str:match("%.$") then
setup = setup .. [[stopper={.\\space}]]
end
+ if str:match("^%d") then
+ -- http://thread.gmane.org/gmane.comp.tex.context/61728/focus=61729
+ setup = setup .. ",start=" .. tonumber(str:match("^%d+")) - 1
+ str = "n"
+ end
setup = setup
str = itemstripper:match(str)
str = enumeration_types[str] or str
- if str:match("^%d") then
- offset = tonumber(str:match("^%d+")) - 1
- str = "n"
- end
- return {setup = setup, str = str, offset = offset}
+ return {setup = setup, str = str}
end
function rst_context.startitemize(str)
local setup = ""
local result = ""
- local offset
str = string.strip(str)
local listtype = enumeration_types[str] or parse_itemstring(str)
if type(listtype) == "table" then
- --print(type(listtype), listtype[2])
setup = listtype.setup
- offset = listtype.offset
listtype = listtype.str
end
result = [[
\\startitemize[]] .. listtype .. setup .. [[]
]]
- if offset then
- result = result .. [[
-
-\\setnumber[itemgroup:itemize]{]] .. offset .. [[}
-]]
- end
return result
end