[htmlmixed mode] Fix bug in matching of script types

Closes #1248