Only convert text inside elements that are not SCRIPT or STYLE

See the tests for use cases.

Also fixes a bug whereby it would not convert quotes at the end of a single character, e.g. `"'1'"`.

TODO: Clean up repetition in these tests.
Obsolete comment.