summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index e393b13..593e917 100644
--- a/init.lua
+++ b/init.lua
@@ -59,10 +59,16 @@ local function mode_heading(S)
S:emit(html.tag('h'..level, prose(S,line)))
end
+local function mode_hr(S)
+ local line = S:line()
+ S:emit(html.T.hr"")
+end
+
local mode_patterns = {
{ "^```", mode_code },
{ "^*", mode_list },
{ "^#", mode_heading },
+ { "^%-%-%-", mode_hr },
}
local function match_mode_pattern(S, line)
@@ -75,8 +81,9 @@ end
local function mode_paragraphs(S)
local para = ""
local function finish()
- if para:match("%S") then
- S:emit(T.p(prose(S,para)))
+ local processed = prose(S, para)
+ if tostring(html.html(processed)):match("%S") then
+ S:emit(T.p(processed))
end
para = ""
end
@@ -93,6 +100,7 @@ local function mode_paragraphs(S)
finish()
end
end
+ finish()
end
local function split_lines(text)