Conserve ending newlines in story string template

This commit is contained in:
Cohee
2023-08-26 01:32:39 +03:00
parent 11ba93aa10
commit bca44ba682
2 changed files with 29 additions and 2 deletions

View File

@ -1638,6 +1638,15 @@ function scrollChatToBottom() {
}
}
/**
* Substitutes {{macro}} parameters in a string.
* @param {string} content - The string to substitute parameters in.
* @param {*} _name1 - The name of the user. Uses global name1 if not provided.
* @param {*} _name2 - The name of the character. Uses global name2 if not provided.
* @param {*} _original - The original message for {{original}} substitution.
* @param {*} _group - The group members list for {{group}} substitution.
* @returns {string} The string with substituted parameters.
*/
function substituteParams(content, _name1, _name2, _original, _group) {
_name1 = _name1 ?? name1;
_name2 = _name2 ?? name2;