diff options
Diffstat (limited to 'lua')
-rw-r--r-- | lua/river.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/river.lua b/lua/river.lua index d060ba9..cd867af 100644 --- a/lua/river.lua +++ b/lua/river.lua | |||
@@ -4,6 +4,8 @@ | |||
4 | -- vim: fdm=marker | 4 | -- vim: fdm=marker |
5 | -- invoke with: pandoc -t river.lua | 5 | -- invoke with: pandoc -t river.lua |
6 | 6 | ||
7 | os.setlocale("en_US.UTF-8") | ||
8 | |||
7 | local function flow(s) | 9 | local function flow(s) |
8 | return s:gsub("%s+", "\n") | 10 | return s:gsub("%s+", "\n") |
9 | end | 11 | end |
@@ -33,7 +35,7 @@ local function nude(s) | |||
33 | -- Remove dashes (not hyphens) | 35 | -- Remove dashes (not hyphens) |
34 | s = s:gsub('%-%-+', ' ') | 36 | s = s:gsub('%-%-+', ' ') |
35 | s = s:gsub('%-%s', ' ') | 37 | s = s:gsub('%-%s', ' ') |
36 | -- Remove general punctuation | 38 | -- Remove everything that is not letters or numbers |
37 | s = s:gsub('[%.!%?:;,%[%]%(%)<>]', ' ') | 39 | s = s:gsub('[%.!%?:;,%[%]%(%)<>]', ' ') |
38 | -- Remove extra spaces | 40 | -- Remove extra spaces |
39 | s = s:gsub('%s+', ' ') | 41 | s = s:gsub('%s+', ' ') |