Fix highlight_string function for proper highlighting - #3160

This should resolve #3160.