From 53aafd66434d97f5e0e9209650581177e2c79a91 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 18 Nov 2017 22:24:06 +0100 Subject: Lua filters: preload text module (#4077) The `text` module is preloaded in lua. The module contains some UTF-8 aware string functions, implemented in Haskell. The module is loaded on request only, e.g.: text = require 'text' function Str (s) s.text = text.upper(s.text) return s end --- test/lua/uppercase-header.lua | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/lua/uppercase-header.lua (limited to 'test/lua') diff --git a/test/lua/uppercase-header.lua b/test/lua/uppercase-header.lua new file mode 100644 index 000000000..8e86911c0 --- /dev/null +++ b/test/lua/uppercase-header.lua @@ -0,0 +1,9 @@ +local text = require 'text' + +local function str_to_uppercase (s) + return pandoc.Str(text.upper(s.text)) +end + +function Header (el) + return pandoc.walk_block(el, {Str = str_to_uppercase}) +end -- cgit v1.2.3