--- lib/tasks/migrate_from_trac.rake	2010-02-28 17:51:36.000000000 +0100
+++ lib/tasks/migrate_from_trac_pre.rake	2011-06-23 22:44:18.000000000 +0200
@@ -320,17 +320,22 @@
         # This will go into the next line.
         shebang_line = false
         # Reguar expression for start of code
-        pre_re = /\{\{\{/
+        pre_re = /(.*)\{\{\{(.*)/
         # Code hightlighing...
         shebang_re = /^\#\!([a-z]+)/
         # Regular expression for end of code
-        pre_end_re = /\}\}\}/
+        pre_end_re = /(.*)\}\}\}(.*)/
+        # RE for both on the same line
+        pre_re_both = /(.*)\{\{\{(.*)\}\}\}(.*)/
 
         # Go through the whole text..extract it line by line
         text = text.gsub(/^(.*)$/) do |line|
           m_pre = pre_re.match(line)
-          if m_pre
-            line = '<pre>'
+          m_pre_both = pre_re_both.match(line)
+          if m_pre_both
+            line = m_pre_both[1]+'@'+m_pre_both[2]+'@'+m_pre_both[3]
+          elsif m_pre
+            line = m_pre[1]+'<pre>'+m_pre[2]
           else
             m_sl = shebang_re.match(line)
             if m_sl
@@ -339,7 +344,7 @@
             end
             m_pre_end = pre_end_re.match(line)
             if m_pre_end
-              line = '</pre>'
+              line = m_pre_end[1]+'</pre>'+m_pre_end[2]
               if shebang_line
                 line = '</code>' + line
               end
