Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for more delimiters #39

Open
maassg opened this issue Jul 11, 2019 · 0 comments
Open

Allow for more delimiters #39

maassg opened this issue Jul 11, 2019 · 0 comments

Comments

@maassg
Copy link

maassg commented Jul 11, 2019

like so ( renderer.lua ):

`local escape_tags_repl = {
["%"] = "%%",
["^"] = "%^",
["$"] = "%$",
["("] = "%(",
[")"] = "%)",
["."] = "%.",
["["] = "%[",
["]"] = "%]",
[""] = "%",
["+"] = "%+",
["-"] = "%-",
["?"] = "%?"
}

local function escape_tags(tags)

--[[ instead of
local result = {
string_gsub(tags[1], "%%", "%%%%").."%s*",
"%s*"..string_gsub(tags[2], "%%", "%%%%"),
}
]]

local delim1 = string_gsub( tags[1], "[%%%^%$%(%)%.%[%]%%+%-%?]", escape_tags_repl ).."%s"
local delim2 = "%s*"..string_gsub( tags[2], "[%%%^%$%(%)%.%[%]%*%+%-%?]", escape_tags_repl )

return { delim1, delim2 }
end
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant