Clean up pattern HTML