Fixed wrong quote to rsquo replacement

1. replace("\'") replaces only one first entry. global flag should have been added
2. replacing ' with &rsquo; is not a good idea because it's a modification of the original template content. Escaping with \' looks more reasonable. E.g. <span class='stop'> which is a valid tag would be broken with this transformation.