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.
This commit is contained in:
parent
532013a032
commit
7d07c52d09
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue