Removed unnecessary conversion of newlines to html line breaks
Этот коммит содержится в:
@@ -33,7 +33,9 @@ export function formatText(text, options = {}) {
|
|||||||
output = replaceTokens(output, tokens);
|
output = replaceTokens(output, tokens);
|
||||||
|
|
||||||
// replace newlines with html line breaks
|
// replace newlines with html line breaks
|
||||||
output = replaceNewlines(output, options.singleline);
|
if (options.singleline) {
|
||||||
|
output = replaceNewlines(output);
|
||||||
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
@@ -246,11 +248,7 @@ function replaceTokens(text, tokens) {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceNewlines(text, singleline) {
|
function replaceNewlines(text) {
|
||||||
if (!singleline) {
|
|
||||||
return text.replace(/\n/g, '<br />');
|
|
||||||
}
|
|
||||||
|
|
||||||
return text.replace(/\n/g, ' ');
|
return text.replace(/\n/g, ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user