0
text = child.html()
text = text.replace /(#include(\s*&lt;.*&gt;)?)/gi, '<span>$1</span>'
text = text.replace /(main\(.*\))/gi, '<span>$1</span>'
child.html text

http://jsfiddle.net/dcro/XKHC8/

This is an answer from my question: Wrapping strings with a span I dont know how to use coffeescript and the one who answer looks unavailable.

Community
  • 1
  • 1

1 Answers1

1

From js2coffee.org

var text;

text = text.replace(/(#include(\s*&lt;.*&gt;)?)/gi, '<span>$1</span>');

text = text.replace(/(main\(.*\))/gi, '<span>$1</span>');

child.html(text);
Barbara Laird
  • 12,599
  • 2
  • 44
  • 57