liquid_feedback_frontend

view env/format/wiki_text.lua @ 1859:02c34183b6df

Fixed wrong filename in INSTALL file
author bsw
date Tue Nov 28 18:54:51 2023 +0100 (6 months ago)
parents 701a5cf6b067
children
line source
1 function format.wiki_text(wiki_text, formatting_engine)
3 if not formatting_engine then
4 error("Formatting engine identifier required")
5 end
7 local fe
9 for i, fe_entry in ipairs(config.formatting_engines) do
10 if fe_entry.id == formatting_engine then
11 fe = fe_entry
12 break
13 end
14 end
16 if not fe then
17 error("Formatting engine not found")
18 end
20 local html, errmsg, exitcode = assert(
21 extos.pfilter(wiki_text, fe.executable, table.unpack(fe.args or {}))
22 )
24 if exitcode > 0 then
25 trace.debug(html, errmsg)
26 error("Wiki parser process returned with error code " .. tostring(exitcode))
27 elseif exitcode < 0 then
28 trace.debug(html, errmsg)
29 error("Wiki parser process was terminated by signal " .. tostring(-exitcode))
30 end
32 if fe.remove_images then
33 html = string.gsub(html, '<img [^>]*>', '')
34 end
36 return html
38 end

Impressum / About Us