Update comment

This commit is contained in:
Luke Barnard 2017-06-28 14:29:53 +01:00
parent eeb1c33868
commit 9b24f70d00

View file

@ -99,9 +99,8 @@ export function processHtmlForSending(html: string): string {
if (element.tagName.toLowerCase() === 'p') {
contentHTML += element.innerHTML + '<br />';
} else if (element.tagName.toLowerCase() === 'pre') {
// Replace "<br>\n" with "<br>" because the \n is redundant and causes an
// extra newline per line within `<pre>` tags.
// This is a workaround for a bug in draft-js-export-html:
// Replace "<br>\n" with "\n" within `<pre>` tags because the <br> is
// redundant. This is a workaround for a bug in draft-js-export-html:
// https://github.com/sstur/draft-js-export-html/issues/62
contentHTML += '<pre>' +
element.innerHTML.replace(/<br>\n/g, '\n').trim() +