У меня есть такая строка.
var test = "the email body text is <p>the email test is the email tes is the email.</p>
<p><span id="xXmergefield selnameXx5" class="tag mergefield selname" style="background-color: rgba(0, 0, 255, 0.75);" contenteditable="false" **data-replacement="{MERGEFIELD SailName}"**>Sail Name<em id="xXmergefield selnameXx5-remover" class="fas fa-times remover"></em></span></p>"
Для сохранения я хочу, чтобы переменная проверялась как,
var test = "the email body text is <p>the email test is the email tes is the email.</p>{MERGEFIELD SailName}".
Вместо ----
<p><span id="xXmergefield selnameXx5" class="tag mergefield selname" style="background-color: rgba(0, 0, 255, 0.75);" contenteditable="false" data-replacement="{MERGEFIELD SailName}">Sail Name<em id="xXmergefield selnameXx5-remover" class="fas fa-times remover"></em></span></p>
-------- Мне нужно значение атрибута только замена данных - {MERGEFIELD SailName}.
Конечный результат должен быть
var test = "the email body text is <p>the email test is the email tes is the email.</p>{MERGEFIELD SailName}".