Port htmlmixed mode changes

This fixes code coloring of javascript, css, mustache templates, and handlebar templates in HTML files for #2023.