Index: formatter.py
===================================================================
--- formatter.py	(revision 2975)
+++ formatter.py	(working copy)
@@ -107,11 +107,16 @@
                                   self.error)
         text = self.processor(req, text)
         if inline:
-            code_block_start = re.compile('^<div class="code-block">')
+            code_block_start = re.compile('^<div(?:\s+class="([^"]+)")?>')
             code_block_end = re.compile('</div>$')
-            text, nr = code_block_start.subn('<span class="code-block">', text, 1 )
-            if nr:
-                text, nr = code_block_end.subn('</span>', text, 1 )
+            match = re.match(code_block_start, text)
+            if match:
+                if match.group(1) and 'code' in match.group(1):
+                    text, nr = code_block_start.subn('<span class="code-block">', text, 1 )
+                    if nr:
+                        text, nr = code_block_end.subn('</span>', text, 1 )
+                else:
+                    text = "</p>%s<p>" % text
             return text
         else:
             return text
@@ -405,7 +410,7 @@
         args = fullmatch.group('macroargs')
         try:
             macro = WikiProcessor(self.env, name)
-            return macro.process(self.req, args, 1)
+            return macro.process(self.req, args, True)
         except Exception, e:
             self.env.log.error('Macro %s(%s) failed' % (name, args),
                                exc_info=True)
