Skip to content

Commit

Permalink
Handle \r\n properly
Browse files Browse the repository at this point in the history
  • Loading branch information
britzl committed Mar 2, 2018
1 parent b8faba2 commit 4603a8a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions richtext/parse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ local function split_text(text, settings, words)
return
end

-- we don't want to deal with \r\n, remove all \r
text = text:gsub("\r", "")

-- the Lua pattern expects the text to have a linebreak at the end
local added_linebreak = false
if text:sub(-1)~="\n" then
Expand Down

0 comments on commit 4603a8a

Please sign in to comment.