Allow "unsafe" HTML in markdown

This commit is contained in:
Talia 2023-02-27 16:44:39 +01:00
parent 44f1cc549f
commit d38740c493
3 changed files with 3 additions and 2 deletions

View file

@ -1,4 +1,3 @@
local cmark = require 'cmark'
local csv = require 'streamcsv' local csv = require 'streamcsv'
local fun = require 'fun' local fun = require 'fun'
local json = require 'cjson' local json = require 'cjson'

View file

@ -1,3 +1,4 @@
local cmark = require 'cmark'
local restia = require 'restia' local restia = require 'restia'
local params = require 'params' local params = require 'params'
local yaml = require 'lyaml' local yaml = require 'lyaml'
@ -29,7 +30,7 @@ local function read_post(file)
local head, body = restia.utils.frontmatter(content) local head, body = restia.utils.frontmatter(content)
return { return {
head = head and yaml.load(head) or {}; head = head and yaml.load(head) or {};
body = cmark.render_html(cmark.parse_document(body, #body, cmark.OPT_DEFAULT), cmark.OPT_DEFAULT); body = cmark.render_html(cmark.parse_document(body, #body, cmark.OPT_DEFAULT), cmark.OPT_DEFAULT + cmark.OPT_UNSAFE);
} }
end end

View file

@ -12,6 +12,7 @@ local cpath = path:gsub(".lua", ".so"):gsub("/share/", "/lib/")
task.build { task.build {
description = "Builds the page"; description = "Builds the page";
'mkdir -p .luarocks lua_modules';
'luarocks install --only-deps *.rockspec'; 'luarocks install --only-deps *.rockspec';
'tup'; 'tup';
'rm -rf blog/*'; 'rm -rf blog/*';