Preserve whitespace for codesnippet tags using a custom TreeBuilder for beautifulsoup