Fix #2015: add "\sim" to ~ conversion for HTML rendering