old_contents: import logging
  import wikipedia
  
  from storyweb.spiders.util import Spider
  
  
  log = logging.getLogger(__name__)
  
  
  class Wikipedia(Spider):
      
      def search_all(self, card):
          try:
              if card.text is None or not len(card.text.strip()):
                  card.text = wikipedia.summary(card.title)
          except wikipedia.WikipediaException, pe:
              log.exception(pe)
  
new_contents: import logging
  import wikipedia
  
  from storyweb.spiders.util import Spider
  
  
  log = logging.getLogger(__name__)
  
  
  class Wikipedia(Spider):
      
      def search_all(self, card):
          try:
              if card.text is None or not len(card.text.strip()):
                  text = wikipedia.summary(card.title)
                  if text is not None and len(text):
                      text = text.replace('\n', '</p>\n<p>')
                      card.text = '<p>%s</p>' % text
          except wikipedia.WikipediaException, pe:
              log.exception(pe)
  
subject: Include breaks in wikipedia snippets.