Project

General

Profile

Patch #2023 ยป migration.patch

The patch to fix the behaviour. - Karl Heinz Marbaise, 2008-10-11 20:28

View differences:

migrate_from_trac.rake (working copy)
s
end
end
# Preformatted blocks
text = text.gsub(/\{\{\{/, '<pre>')
text = text.gsub(/\}\}\}/, '</pre>')
# We would like to convert the Code highlighting too
# This will go into the next line.
shebang_line = false
# Reguar expression for start of code
pre_re = /\{\{\{/
# Code hightlighing...
shebang_re = /^\#\!([a-z]+)/
# Regular expression for end of code
pre_end_re = /\}\}\}/
# Go through the whole text..extract it line by line
text = text.gsub(/^(.*)$/) do |line|
puts "Line: '" + line + "'"
m_pre = pre_re.match(line)
if m_pre
line = '<pre>'
else
m_sl = shebang_re.match(line)
if m_sl
shebang_line = true
line = '<code class="' + m_sl[1] + '">'
end
m_pre_end = pre_end_re.match(line)
if m_pre_end
line = '</pre>'
if shebang_line
line = '</code>' + line
end
end
end
line
end
# Highlighting
text = text.gsub(/'''''([^\s])/, '_*\1')
text = text.gsub(/([^\s])'''''/, '\1*_')
    (1-1/1)