Project

General

Profile

Patch #15975 ยป migrate_from_trac.headings.patch

fix regex for headings - Bernhard Wenzel, 2014-01-27 16:24

View differences:

migrate_from_trac.rake.headings 2014-01-27 16:10:48.673060694 +0100
# Basic wiki syntax conversion
def self.convert_wiki_text(text)
# Titles
text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
text = text.gsub(/^\s*(\=+)\s(.+)\s(\=+)\s*$/) {|s| "\nh#{$1.length}. #{$2}\n"}
# External Links
text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"}
# Ticket links:
    (1-1/1)