move open-quote finding code out of if-closing-quote-found code