Detect code line by line and improve char escaping.