import re


def _pretty_parse(item):
   """Prettifies an inputted string containing Wikipedia page content."""
   if not isinstance(item, str):
      raise TypeError(f"Expected a string containing Wikipedia page content, got {type(item)}")

   # Remove all header/footer links from page.
   item = re.sub('\\[.{0,3}\\]', '', item)

   # Add spaces after periods if necessary.
   item = re.sub('\\.(?!\\s|$|"|\')', '. ', item)

   # Turn escaped apostrophes into literal apostrophes.
   item = item.replace("\'", "'")

   # Remove \u200 unicode characters.
   item = re.sub(r'[^\x00-\x7F]+', '', item)

   # Turn newlines into commas and spaces.
   item = re.sub('\n', ', ', item)

   return item