2018-01-18 10:53:39 +00:00
|
|
|
// cleans whitespace from a string, for example for cleaning
|
|
|
|
// textContent in DOM nodes with indentation
|
2018-01-15 12:49:08 +00:00
|
|
|
export default function cleanWhitespace(string) {
|
2021-12-28 14:45:20 +00:00
|
|
|
return string.replace(/\n/g, '').replace(/ +/g, ' ').trim();
|
2018-01-15 12:49:08 +00:00
|
|
|
}
|