Re: textile preformatter

Wari Wahab <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Mark Smith wrote:

> The preformatter is straightforward:
> ---------------------------
> import os
> from pytextile import textile
> from libs.preformatters.base import PreFormatterBase
>
> class PreFormatter(PreFormatterBase):
>   def parse(self):
>     return textile(os.linesep.join(self.text))

To fix the new line breaks bug, just replace the whole preformatter with 
this:
--------------------
import os
from pytextile import textile
from libs.preformatters.base import PreFormatterBase

class PreFormatter(PreFormatterBase):
  def parse(self):
    return textile(''.join(self.text))
--------------------

Forgotten the fact that line line of text in self.text contains a '/n'. 
That's why Kai experienced problems with it.



-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.