Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions slack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ end
-- Comments indicate the types of other variables.

function Str(s)
return escape(s)
return s
end

function Space()
Expand All @@ -98,8 +98,10 @@ function SmallCaps(s)
end

function Link(s, src, tit)
return "<a href='" .. escape(src,true) .. "' title='" ..
escape(tit,true) .. "'>" .. s .. "</a>"
-- slack doc (https://api.slack.com/reference/surfaces/formatting#linking-urls)
-- says this works but it doesn't:
-- return "<" .. escape(src,true) .. "|" .. s .. ">"
return escape(src,true)
end

function Image(s, src, tit)
Expand Down Expand Up @@ -273,6 +275,9 @@ meta.__index =
setmetatable(_G, meta)


function SoftBreak()
return " "
end

function LineBreak()
return "\n"
Expand All @@ -291,7 +296,7 @@ function Strikeout(s)
end

function Code(s, attr)
return '```' .. s .. '```'
return '`' .. s .. '`'
end

function Header(lev, s, attr)
Expand Down