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)

@@ -260,21 +260,16 @@
         
-card.
 text = w
@@ -297,16 +297,177 @@
 .title)%0A
+                if text is not None and len(text):%0A                    text = text.replace('%5Cn', '%3C/p%3E%5Cn%3Cp%3E')%0A                    card.text = '%3Cp%3E%25s%3C/p%3E' %25 text%0A
         

Include breaks in wikipedia snippets.