New templates, node advanced display, style fixes

This commit is contained in:
barsdeveloper
2022-04-25 14:05:15 +02:00
parent 81276a86be
commit 4b563f023e
19 changed files with 415 additions and 163 deletions

View File

@@ -149,13 +149,22 @@ export default class Utility {
/**
* @param {String} value
*/
static sanitizeInputString(value) {
static sanitizeString(value, input = false) {
return value
.replace(/\n$/, "") // Remove trailing newline
.replaceAll("\u00A0", " ") // Replace special space symbol
.replaceAll("\n", String.raw`\r\n`) // Replace newline with \r\n
}
/**
* @param {String} value
*/
static renderInputString(value) {
return value
.replaceAll(" ", "\u00A0") // Replace special space symbol
.replaceAll(String.raw`\r\n`, "<br />\n") // Replace newline with \r\n
}
/**
* @param {String} value
*/