let str = str.replace(/\n|\r\n|\r/g, '<br>');
https://stackoverflow.com/questions/1818310/regular-expression-to-remove-a-files-extension
var input = 'myfile.png';
var output = input.substr(0, input.lastIndexOf('.')) || input;
https://stackoverflow.com/questions/190852/how-can-i-get-file-extensions-with-javascript
return filename.split('.').pop();
https://stackoverflow.com/questions/43931283/javascript-string-replace-short-tags-with-brackets
var string = '<div id="test">A little [prefix] test</div>';
var replace = string.replace(/\[prefix\]/g, "replaced");
console.log(replace);