regression: preview format text for edge cases (#5172)
This commit is contained in:
parent
96bb25e5b4
commit
f5da42aae4
|
@ -8,8 +8,11 @@ export const previewFormatText = (msg: string) => {
|
||||||
let m = formatText(msg);
|
let m = formatText(msg);
|
||||||
m = formatHyperlink(m);
|
m = formatHyperlink(m);
|
||||||
m = shortnameToUnicode(m);
|
m = shortnameToUnicode(m);
|
||||||
|
// Removes sequential empty spaces before to use removeMarkdown,
|
||||||
|
// because with some edge cases the library takes a long time to finish the process
|
||||||
|
m = m.replace(/\s+/g, ' ');
|
||||||
m = removeMarkdown(m);
|
m = removeMarkdown(m);
|
||||||
// Removes sequential empty spaces
|
// Removes sequential empty spaces to remove leading empty space on quotes at the rooms list view
|
||||||
m = m.replace(/\s+/g, ' ');
|
m = m.replace(/\s+/g, ' ');
|
||||||
m = m.replace(/\n+/g, ' ');
|
m = m.replace(/\n+/g, ' ');
|
||||||
return m;
|
return m;
|
||||||
|
|
Loading…
Reference in New Issue