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.

Comments

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

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 7.6.6

Due in version: 7.6.7

Sprint:

Story Points: 1

Cycle: 4