Project

General

Profile

Actions

Defect #3910

open

Trac to Redmine wiki migration problems

Added by Kamil . over 14 years ago. Updated about 12 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Importers
Target version:
-
Start date:
2009-09-23
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Some wiki formattings are well converted, bot some are not (which is very frustrating...)
Examples:
1) Links conversion:
- In Trac the syntax for "subsites" is: FooBar/LazyFox.
In redmine now it is converted to FooBarLazyFox but is not "visible" as a subsite

- In Trac the syntax for url with description is: [WikiSite/WikiSubSite here is the description]
This should be converted to: [[WikiSite_WikiSubSite|here is the description]]

2) Headings
Foo & Bar & Something === Something! ===

was converted in something weird...

Regards

Actions #1

Updated by Kamil . over 14 years ago

In 1 it was:

This should be converted to: [[WikiSite/WikiSubSite|here is the description]]

In 2 it was:

== Foo & Bar & Something ==
=== Something! ===

regards

Actions #2

Updated by Kamil . over 14 years ago

I have discovered, that this

== Foo & Bar & Something ==
=== Something! ===

without empty line between headers works fine with Trac, but is converted to
h2. Foo & Bar & Something == 
Something! === 

which is rendered in not proper way.
I have also discovered that lack of empty line between
h2. Foo & Bar & Something 
Something

also results in wrong rendering

regards

Actions #3

Updated by tdev . about 14 years ago

this problem is still present. I have fixed the code a bit to convert headers with whitespaces in front correctly:

open file lib/tasks/migrate_from_trac.rake

and replace

text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}

with
text = text.gsub(/(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}

Actions #4

Updated by Camille NERON about 13 years ago

Kamil . wrote:

Some wiki formattings are well converted, bot some are not (which is very frustrating...)
Examples:
1) Links conversion:
- In Trac the syntax for "subsites" is: FooBar/LazyFox.
In redmine now it is converted to FooBarLazyFox but is not "visible" as a subsite

- In Trac the syntax for url with description is: [WikiSite/WikiSubSite here is the description]
This should be converted to: here is the description

to fix the issue wiki link, add this regex :

text = text.gsub(/\[([^\s\]]+)\s(.*)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}

after :

        # Internal Links
        text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below
        text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
        text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
        text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
        text = text.gsub(/\[wiki:([^\s\]]+)\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
        text = text.gsub(/\[wiki:([^\s\]]+)\s(.*)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}
Actions #5

Updated by Etienne Massip about 13 years ago

  • Category set to Importers
Actions #6

Updated by Leo Shklovskii about 12 years ago

Both of these are still problems in the importer and they're really easy fixes to the core code. It would be great to get them checked in.

tdev's regex fix didn't work for me. The issue isn't the start of line matching, but rather the greedy .* match. This expression works better - it's a much rarer case to have an equals sign inside the title:

    # Titles
    text = text.gsub(/(\=+)\s+([^=]+)\s+(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
Actions

Also available in: Atom PDF