Skip to content

Commit

Permalink
fixes #1037 - support originalInputValueFormat setting in mix-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Yair Even Or authored and Yair Even Or committed Jun 4, 2022
1 parent ec6444a commit 5a0de8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tagify.js
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,9 @@ Tagify.prototype = {
getMixedTagsAsString(){
var result = "",
that = this,
_interpolator = this.settings.mixTagsInterpolator;
_s = this.settings,
originalInputValueFormat = _s.originalInputValueFormat || JSON.stringify,
_interpolator = _s.mixTagsInterpolator;

function iterateChildren(rootNode){
rootNode.childNodes.forEach((node) => {
Expand All @@ -1688,7 +1690,7 @@ Tagify.prototype = {
if( tagData.__removed )
return;
else
result += _interpolator[0] + JSON.stringify( omit(tagData, that.dataProps) ) + _interpolator[1]
result += _interpolator[0] + originalInputValueFormat( omit(tagData, that.dataProps) ) + _interpolator[1]
}
else if( node.getAttribute('style') || ['B', 'I', 'U'].includes(node.tagName) )
result += node.textContent;
Expand Down

0 comments on commit 5a0de8f

Please sign in to comment.