Correctly detect open HTML tags in `String::substrHtml()` (see #5669)