Skip to content
Permalink
Browse files

Books: Convert \r to \n

Some files or editors may use \r instand of \n like notepad++. If you copy
text written in notepad++ and pasted into the book. The book will only have
one page.
  • Loading branch information...
Coder12a authored and paramat committed Oct 16, 2017
1 parent 454e0da commit 045abbd6d7bac8d4706731cb36c1c15dd98fdf13
Showing with 1 addition and 0 deletions.
  1. +1 −0 mods/default/craftitems.lua
@@ -112,6 +112,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
data.description = "\""..short_title.."\" by "..data.owner
data.text = fields.text:sub(1, max_text_size)
data.text = data.text:gsub("\r\n", "\n"):gsub("\r", "\n")
data.page = 1
data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp)

0 comments on commit 045abbd

Please sign in to comment.
You can’t perform that action at this time.