Should make a second call to HTMLInstrumentation.generateInstrumentedHTML(editor.document) to make sure scanDocument doesn't call getText() again.