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