From 36e010cb4a3dc2de2eca7286e62873ad5dfde1a8 Mon Sep 17 00:00:00 2001 From: William Lupton Date: Thu, 8 Oct 2020 17:42:36 +0100 Subject: Fix apparent typos in sample.lua (#6729) --- data/sample.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'data') diff --git a/data/sample.lua b/data/sample.lua index 5752d2684..b87848378 100644 --- a/data/sample.lua +++ b/data/sample.lua @@ -21,7 +21,7 @@ local stringify = (require "pandoc.utils").stringify -- configure the writer. local meta = PANDOC_DOCUMENT.meta --- Chose the image format based on the value of the +-- Choose the image format based on the value of the -- `image_format` meta value. local image_format = meta.image_format and stringify(meta.image_format) @@ -45,9 +45,9 @@ local function escape(s, in_attribute) return '>' elseif x == '&' then return '&' - elseif x == '"' then + elseif in_attribute and x == '"' then return '"' - elseif x == "'" then + elseif in_attribute and x == "'" then return ''' else return x @@ -141,8 +141,8 @@ function Strikeout(s) return '' .. s .. '' end -function Link(s, src, tit, attr) - return "" .. s .. "" end @@ -271,7 +271,7 @@ end -- Convert pandoc alignment to something HTML can use. -- align is AlignLeft, AlignRight, AlignCenter, or AlignDefault. -function html_align(align) +local function html_align(align) if align == 'AlignLeft' then return 'left' elseif align == 'AlignRight' then @@ -286,7 +286,7 @@ end function CaptionedImage(src, tit, caption, attr) return '
\n\n' .. - '

' .. caption .. '

\n
' + '

' .. escape(caption) .. '

\n' end -- Caption is a string, aligns is an array of strings, @@ -357,4 +357,3 @@ meta.__index = return function() return "" end end setmetatable(_G, meta) - -- cgit v1.2.3