U4-10396 - ReplaceLineBreaksForHtml should include \r

Created by Claus Jensen 08 Sep 2017, 12:03:27 Updated by Claus Jensen 08 Sep 2017, 12:08:42

Tags: Unscheduled PR

ReplaceLineBreaksForHtml only replaces \n with <br />. It should include all types of linebreak such as \r\n, \r and \n.


Claus Jensen 08 Sep 2017, 12:07:38

Fixed in PR: https://github.com/umbraco/Umbraco-CMS/pull/2126 by @Harvey - Thank you! :)

I've changed it a bit though. Using a regex seems like a pretty solution, but regexes are really heavy to instantiate for something as simple as this. Running this method with a regex is about 11x times slower than simply doing 3 string.Replace in a row.

Also added a unit test for this.

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 7.6.6

Due in version: 7.6.7


Story Points: 1

Cycle: 4