One of my tasks involves manipulating a string variable in the following manner:
domNodes += '<a href="javascript: void(0);" data-role="node_jump" data-node="'+this.tagName.toLowerCase()+'">'+this.tagName + "</a>" + " » ";
In addition, I am working with an array that contains a 2D array. The first element is the string to be identified and the second element is the replacement string:
var replaceTags = [["i", "em"], ["b", "strong"]];
Essentially, I need to replace certain tags based on predetermined rules. For example, if this.tagName
matches i
, it should be replaced with em
. This also applies to b
and strong
.
I have successfully accomplished this task in the past, but unfortunately, I cannot recall the exact method right now.