Feature/1269 improve quoting recognition

Closes #1269.