diff -r 9dd23e6b13fc -r c78a885f46fa trac/htdocs/css/trac.css
--- a/trac/htdocs/css/trac.css	Mon Oct 22 12:38:31 2007 +0200
+++ b/trac/htdocs/css/trac.css	Mon Oct 22 13:28:31 2007 +0200
@@ -310,6 +310,15 @@ span.closed { text-decoration: line-thro
 span.closed { text-decoration: line-through }
 span.forbidden, a.forbidden { background: #fafaf0; color: #998; }
 
+/* User-selectable styles for blocks */
+.important {
+ background: #fcb;
+ border: 1px dotted #d00;
+ color: #500;
+ padding: 0 .5em 0 .5em;
+ margin: .5em;
+}
+
 dl.wiki dt { font-weight: bold }
 dl.compact dt { float: left; padding-right: .5em }
 dl.compact dd { margin: 0; padding: 0 }
diff -r 9dd23e6b13fc -r c78a885f46fa trac/wiki/formatter.py
--- a/trac/wiki/formatter.py	Mon Oct 22 12:38:31 2007 +0200
+++ b/trac/wiki/formatter.py	Mon Oct 22 13:28:31 2007 +0200
@@ -24,25 +24,26 @@ import urllib
 
 from StringIO import StringIO
 
-from genshi.builder import tag
-from genshi.core import Stream
+from genshi.builder import tag, Element
+from genshi.core import Stream, Markup, escape
+from genshi.util import plaintext
 
 from trac.context import get_relative_url
 from trac.core import *
 from trac.mimeview import *
 from trac.util.compat import set
-from trac.wiki.api import WikiSystem
+from trac.wiki.api import WikiSystem, parse_args
 from trac.wiki.parser import WikiParser
-from trac.util.html import escape, plaintext, Markup, Element, html
 from trac.util.text import shorten_line, to_unicode
+from trac.util.translation import _
 
 __all__ = ['wiki_to_html', 'wiki_to_oneliner', 'wiki_to_outline',
            'wiki_to_link', 'Formatter',
            'format_to', 'format_to_html', 'format_to_oneliner', 'extract_link']
 
 def system_message(msg, text=None):
-    return html.DIV(html.STRONG(msg), text and html.PRE(text),
-                    class_="system-message")
+    return tag.div(tag.strong(msg), text and tag.pre(text),
+                   class_="system-message")
 
 
 def _markup_to_unicode(markup):
@@ -60,18 +61,27 @@ class WikiProcessor(object):
 
     _code_block_re = re.compile('^<div(?:\s+class="([^"]+)")?>(.*)</div>$')
 
-    def __init__(self, formatter, name):
-        """Since 0.11: first argument is a Formatter instead of an Environment.
+    def __init__(self, formatter, name, args={}):
+        """Find the processor by name
+        
+        :param formatter: the formatter embedding a call for this processor 
+        :param name: the name of the processor 
+        :param args: extra parameters for the processor
+
+        (since 0.11)
         """
         self.formatter = formatter
         self.env = formatter.env
         self.name = name
+        self.args = args
         self.error = None
         self.macro_provider = None
 
         builtin_processors = {'html': self._html_processor,
                               'default': self._default_processor,
-                              'comment': self._comment_processor}
+                              'comment': self._comment_processor,
+                              'div': self._div_processor,
+                              'span': self._span_processor}
         
         self.processor = builtin_processors.get(name)
         if not self.processor:
@@ -117,8 +127,25 @@ class WikiProcessor(object):
             return (stream | sanitizer).render('xhtml', encoding=None)
         except ParseError, e:
             self.env.log.warn(e)
-            return system_message('HTML parsing error: %s' % escape(e.msg),
-                                  text.splitlines()[e.lineno - 1].strip())
+            line = unicode(text).splitlines()[e.lineno - 1].strip()
+            return system_message(_('HTML parsing error: %(message)s',
+                                    message=escape(e.msg)), line)
+        
+    def _div_processor(self, text):
+        if 'class' in self.args:
+            self.args['class_'] = self.args['class']
+            del self.args['class']
+        return self._html_processor(
+            tag.div(format_to_html(self.formatter.context, text), **self.args))
+
+    def _span_processor(self, text):
+        args, kwargs = parse_args(text)
+        if 'class' in kwargs:
+            kwargs['class_'] = kwargs['class']
+            del kwargs['class']
+        return self._html_processor(
+            tag.span(format_to_oneliner(self.formatter.context,
+                                        ', '.join(args)), **kwargs))
 
     # generic processors
 
@@ -172,7 +199,7 @@ class WikiProcessor(object):
                 elif text.startswith('<table'):
                     interrupt_paragraph = True
             if content_for_span:
-                text = html.SPAN(class_='code-block')(*content_for_span)
+                text = tag.span(class_='code-block')(*content_for_span)
             elif interrupt_paragraph:
                 text = "</p>%s<p>" % to_unicode(text)
         return text
@@ -278,10 +305,10 @@ class Formatter(object):
         return self.simple_tag_handler(match, '<sup>', '</sup>')
 
     def _inlinecode_formatter(self, match, fullmatch):
-        return html.TT(fullmatch.group('inline'))
+        return tag.tt(fullmatch.group('inline'))
 
     def _inlinecode2_formatter(self, match, fullmatch):
-        return html.TT(fullmatch.group('inline2'))
+        return tag.tt(fullmatch.group('inline2'))
 
     # -- Post- IWikiSyntaxProvider rules
 
@@ -329,7 +356,7 @@ class Formatter(object):
                                         path)
                 if '?' in path:
                     query = '&' + query.lstrip('?')
-            return html.A(label or rel, href=path + query + fragment)
+            return tag.a(label or rel, href=path + query + fragment)
         else:
             return self._make_link(ns, target, match, label)
 
@@ -392,13 +419,13 @@ class Formatter(object):
         local_url = self.env.config.get('project', 'url') or \
                     (self.req or self.env).abs_href.base
         if not url.startswith(local_url):
-            return html.A(html.SPAN(text, class_="icon"),
+            return tag.a(tag.span(text, class_="icon"),
                           class_="ext-link", href=url, title=title or None)
         else:
-            return html.A(text, href=url, title=title or None)
+            return tag.a(text, href=url, title=title or None)
 
     def _make_mail_link(self, url, text, title=''):
-        return html.A(html.SPAN(text, class_="icon"),
+        return tag.a(tag.span(text, class_="icon"),
                       class_="mail-link", href=url, title=title or None)
 
     # WikiMacros
@@ -706,10 +733,16 @@ class Formatter(object):
             else:
                 self.code_text += line + os.linesep
         elif not self.code_processor:
-            match = WikiParser._processor_re.search(line)
+            match = WikiParser._processor_re.match(line)
             if match:
                 name = match.group(1)
-                self.code_processor = WikiProcessor(self, name)
+                args = WikiParser._processor_param_re.split(line[len(name):])
+                del args[::3]
+                keys = [str(k) for k in args[::2]] # used as keyword parameters
+                values = [v and v[0] in '"\'' and v[1:-1] or v
+                          for v in args[1::2]]
+                args = dict(zip(keys, values))
+                self.code_processor = WikiProcessor(self, name, args)
             else:
                 self.code_text += line + os.linesep 
                 self.code_processor = WikiProcessor(self, 'default')
diff -r 9dd23e6b13fc -r c78a885f46fa trac/wiki/parser.py
--- a/trac/wiki/parser.py	Mon Oct 22 12:38:31 2007 +0200
+++ b/trac/wiki/parser.py	Mon Oct 22 13:28:31 2007 +0200
@@ -105,6 +105,7 @@ class WikiParser(Component):
         r"(?P<table_cell>\|\|)"]
 
     _processor_re = re.compile('#\!([\w+-][\w+-/]*)')
+    _processor_param_re = re.compile(r'''[\s;]*(\w+)=(".*?"|'.*?'|\w+)''')
     _anchor_re = re.compile('[^\w:.-]+', re.UNICODE)
 
     def __init__(self):

