jwebsite/utils.jl

15 lines
362 B
Julia
Raw Normal View History

2020-06-14 04:13:31 +00:00
using Markdown
2020-06-13 16:55:03 +00:00
2020-06-14 04:13:31 +00:00
function lx_escape(com, _)
# keep this first line
content = Franklin.content(com.braces[1]) # input string
lang, code = split(content, "::")
scode = strip(code)
esc_code = Markdown.htmlesc(scode)
io = IOBuffer()
println(io, "```$lang")
println(io, esc_code)
println(io, "```")
return String(take!(io))
2020-06-13 16:55:03 +00:00
end