I wanna do something that would work much like this shortcode in stackexchange.
So basically I want to wrap text with distinct markers and .wrap()
them in spans with specific classes accordingly... while also removing the markers that once existed.
I found this Find Text Between 2 Quotes with jQuery but it gives little help as i could only make it work as it was.
This explains a little further: http://jsfiddle.net/ALfsT/3/
I have no idea where to go with this.
You need to escape the
*
characters :/\*\*(.*?)\*\*/
I also suggest that you use a callback function to wrap your text : https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace
Thanks @Guffa for the help here
http://jsfiddle.net/mplungjan/AkCED/
update:
now we need to code stuff like this http://jsfiddle.net/mplungjan/bhTAM/
You changed to class=texts I changed it back to id=texts and it worked better