Added block extraction and whitespace preservation.