diff options
author | Florrie <towerofnix@gmail.com> | 2018-11-15 17:40:56 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-11-15 17:40:56 -0400 |
commit | 2bcafc451ff8c930909ec8bf6ccef2dc706b627b (patch) | |
tree | 70a238e7812c8969e06da1888a76bfbbc43d07ff /index.js | |
parent | 3546621b3f523948a7b16407c173ccbb48f26c30 (diff) |
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.
Diffstat (limited to 'index.js')
-rwxr-xr-x | index.js | 2 |
1 files changed, 1 insertions, 1 deletions
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) => `<a href="/topics/${id}">${filterHTML(name.trim())}</a>`, 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 |