fix and test for https://github.com/Khan/live-editor/issues/203
Merge pull request #213 from kevinb7/issue-203

fix and test for issue 203