From 624597b9a1dcc821a2d6b2ad000f134f75f5ef96 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 3 Jun 2013 18:55:29 +0200 Subject: fix single-line image directives --- mod/tex/context/third/rst/rst_directives.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mod/tex/context/third/rst/rst_directives.lua') diff --git a/mod/tex/context/third/rst/rst_directives.lua b/mod/tex/context/third/rst/rst_directives.lua index d1be13b..b64bafc 100644 --- a/mod/tex/context/third/rst/rst_directives.lua +++ b/mod/tex/context/third/rst/rst_directives.lua @@ -4,7 +4,7 @@ -- USAGE: called by rst_parser.lua -- DESCRIPTION: Complement to the reStructuredText parser -- AUTHOR: Philipp Gesang (Phg), --- CHANGED: 2013-03-26 22:45:45+0100 +-- CHANGED: 2013-06-03 18:52:35+0200 -------------------------------------------------------------------------------- -- @@ -73,19 +73,22 @@ local function img_setup (properties) end rst_directives.image = function(data) + rst_context.addsetups "image" local inline_parser = rst_context.inline_parser local properties = {} local anon = false local rdi = rst_directives.images local hp = helpers.patterns local caption = "" - local name + local name = "" if data.name then name = stringstrip(data.name) data.name = nil else - name = data[1] + if next(data[1]) then + name = data[1][1] + end end --rd.anonymous = rd.anonymous + 1 -- cgit v1.2.3