diff options
author | ubq323 <ubq323@ubq323.website> | 2025-06-10 19:58:38 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2025-06-10 19:58:38 +0100 |
commit | db64eeb9bc128682e077217cc1d8830cfc10d88f (patch) | |
tree | 62a19d39f45164e119a96750e8b758b4ea247914 | |
parent | acc825b90a801fc719e680f60e2fd62fe25a7ccd (diff) |
-rw-r--r-- | init.lua | 6 | ||||
-rw-r--r-- | prose.lua | 2 |
2 files changed, 8 insertions, 0 deletions
@@ -54,11 +54,17 @@ local function mode_hr(S) S:emit(html.T.hr"") end +-- bad! bad! bad! +local function mode_insect(S) S:line() S:emit(html.safe"<section>") end +local function mode_unsect(S) S:line() S:emit(html.safe"</section>") end + local mode_patterns = { { "^```", mode_code }, { "^*", mode_list }, { "^#", mode_heading }, { "^%-%-%-", mode_hr }, + { "^<<", mode_insect }, + { "^>>", mode_unsect }, } local function match_mode_pattern(S, line) @@ -119,6 +119,8 @@ extensions.def = function(S,text,name) extensions[name]=fn() end +extensions.raw = function(S,text) return html.safe(text) end + setmetatable(extensions, {__index = function(t, k) return function(S, text) io.stderr:write("warning: unknown extension "..k.."\n") |