From 2bcafc451ff8c930909ec8bf6ccef2dc706b627b Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 15 Nov 2018 17:40:56 -0400 Subject: Split along \r too Some old projects (e.g. 38201) use \r instead of \n as the line separator character. This commit acknowledges that in the longField function. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b396421..1619d6a 100755 --- a/index.js +++ b/index.js @@ -95,7 +95,7 @@ const templates = { forumThread: (name, id) => `${filterHTML(name.trim())}`, longField: text => { - return text.split('\n') + return text.split(/\r\n|\r|\n/g) .map(filterHTML) .reduce((arr, l, i, lines) => [...arr.slice(0, -1), ...l.trim().length -- cgit 1.3.0-6-gf8a5