This is Replace text script.
I call it like this:
$(document).ready(function() {
$('#test-id').replaceText(/\[this\]/g,'<b>').replace(/\[\/this\]/g,'</b>');
});
It should make bold [this] bold text [/this] only, HTML below:
<span id="test-id"> [this] This is some text that contains [/this] red color with bold text</span>
It should bold text only inside this [this][/this] , but problem is it also make bold others the text and not hide last [/this] one.
I also tried to call this one:
$('#test-id').replaceText(/\[this\]/g,'<b>');
So please advice how to replace only [this] This is some text that contains [/this], not other text and hide last [/this] one.
Please see Fiddle: http://jsfiddle.net/vw5b1szm/1/
Thanks.