[#1] Fix locals at the end of the block not being marked as ones
[#1] writer: Replace tab and newline characters with escape sequences

Consider a string to be a multiline string only if there is more than
two newline characters.