~technomancy/fennel

Don't emit headers twice v1 PROPOSED

Benaiah Mischenko: 1
 Don't emit headers twice

 1 files changed, 2 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~technomancy/fennel/patches/10406/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Don't emit headers twice Export this patch

---
Fixes a small issue with the last patch I sent in. Also corrects the comment.
 promote-h1-to-title.lua | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/promote-h1-to-title.lua b/promote-h1-to-title.lua
index 1647c76..d5eef63 100644
--- a/promote-h1-to-title.lua
+++ b/promote-h1-to-title.lua
@@ -1,16 +1,14 @@
local title

--- Promote all headers by one level. Set title from level 1 headers,
--- unless it has been set before.
-- Set title from level 1 headers, unless it has been set before.
function promote_header (header)

  if header.level >= 2 then
    return header
  end

  if not title then
    title = header.content
    return nil
    return {}
  end

  local msg = '[WARNING] title already set; demoting header "%s"\n'
-- 
2.26.2
Benaiah Mischenko <benaiah@mischenko.com> writes: