The items in self.prev maybe already has trailing '\n'.