summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-11-18 13:33:37 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-11-18 13:33:37 -0800
commit17f6621b21fa9c5b64f58e4da38a3ce53b50f7b9 (patch)
tree012be70ba61a3297d06d5a20216628462d028761
parent38ab2eeb9e3c40d5830d7b3aef5d1b78131f3924 (diff)
Update man page lua filter to use text module.
-rw-r--r--doc/lua-filters.md5
-rw-r--r--man/manfilter.lua9
2 files changed, 10 insertions, 4 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index a5c9905ab..35610cea3 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -344,11 +344,14 @@ inside headers), removes footnotes, and replaces links
with regular text.
``` lua
+-- we use preloaded text to get a UTF-8 aware 'upper' function
+local text = require('text')
+
function Header(el)
if el.level == 1 then
return pandoc.walk_block(el, {
Str = function(el)
- return pandoc.Str(el.text:upper())
+ return pandoc.Str(text.upper(el.text))
end })
end
end
diff --git a/man/manfilter.lua b/man/manfilter.lua
index 81968ad2f..c6bbd02c4 100644
--- a/man/manfilter.lua
+++ b/man/manfilter.lua
@@ -1,19 +1,22 @@
--- filters to create the pandoc man page from MANUAL.txt
+-- we use preloaded text to get a UTF-8 aware 'upper' function
+local text = require('text')
--- capitalize headers
+-- capitalize level 1 headers
function Header(el)
if el.level == 1 then
return pandoc.walk_block(el, {
Str = function(el)
- return pandoc.Str(el.text:upper())
+ return pandoc.Str(text.upper(el.text))
end })
end
end
+-- replace links with link text
function Link(el)
return el.content
end
+-- remove notes
function Note(el)
return {}
end