From 749e1fc069d9db1ea3d6a91388c2c0a5fce7adce Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sun, 29 Jan 2017 09:46:12 -0500 Subject: [PATCH] try escaping pipe --- contrib/lua/memeposting.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/lua/memeposting.lua b/contrib/lua/memeposting.lua index 79aa948..5a1d879 100644 --- a/contrib/lua/memeposting.lua +++ b/contrib/lua/memeposting.lua @@ -17,12 +17,16 @@ function psy_text(str) return span_text("psy", str) end +function pre_text(str) + return span_text("code", str:gsub("%|", "|")) +end + -- generate extra markup function memeposting(body, prefix) + body = string.gsub(body, "`(.-)`", pre_text) body = string.gsub(body, "%(%(%((.-)%)%)%)", function(str) return string.format("
%s
", prefix, str) end) - body = string.gsub(body, "%[%[%[(.-)%]%]%]", wobble_text) + body = string.gsub(body, "|(.-)|", wobble_text) body = string.gsub(body, "//(.-)\\\\", explode_text) body = string.gsub(body, "/@(.-)@\\", psy_text) - body = string.gsub(body, "`(.-)`", pre_text) return body end