Hello everyone.
I have following JS code (stripped to minimal size where problem still exists)
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<div id="debug">this is <em>test</em></div>
<script type="text/javascript">
var string1 = $('#debug').html();
var string2 = string1.replace(/<em>/g, '<strong>');
string2 = string2.replace(/<\/em>/g, '</strong>');
$('#debug').html( string2 );
</script>
</body>
</html>
In Firefox everything works and <em> tags are replaced with <strong>.
But in Opera <em>'s are stay in place. Furthermore, any other HTML tags are not captured by regexps at all.
Is there any way to fix this behaviour? I need not only to replace tags, but to parse their content too (href attributes for example).