fix handling of brackets in lecture; better test coverage
better error handling for end quote