filter string at appropriate places, detect block begins that also end on the same line