Escape scratchblocks before writing to html temp file