# -*- coding: iso-8859-1 -*-

import re
from MoinMoin.parser import wiki

def repl(matchobj):
    return matchobj.group(1)+"[[BR]]\n"+matchobj.group(2)

class Parser(wiki.Parser):
    """
    We do almost the same, just not drop single newlines
    """
    nld = re.compile(r"([\w\d])\r?\n([\w\d])")
    def format(self, formatter):
        """
        Format
        """
        #self.nld.finditer(self.raw)
        self.raw = self.nld.sub(repl,self.raw)
        #print self.raw;
        wiki.Parser.format(self, formatter)
