https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292009-09-23T10:03:52ZRedmineRedmine - Defect #3910: Trac to Redmine wiki migration problemshttps://www.redmine.org/issues/3910?journal_id=111022009-09-23T10:03:52ZKamil .
<ul></ul><p>In 1 it was:<br /><pre>
This should be converted to: [[WikiSite/WikiSubSite|here is the description]]
</pre></p>
<p>In 2 it was:<br /><pre>
== Foo & Bar & Something ==
=== Something! ===
</pre></p>
<p>regards</p> Redmine - Defect #3910: Trac to Redmine wiki migration problemshttps://www.redmine.org/issues/3910?journal_id=123602009-11-23T17:19:11ZKamil .
<ul></ul><p>I have discovered, that this <br /><pre>
== Foo & Bar & Something ==
=== Something! ===
</pre><br />without empty line between headers works fine with Trac, but is converted to <br /><pre>
h2. Foo & Bar & Something ==
Something! ===
</pre><br />which is rendered in not proper way.<br />I have also discovered that lack of empty line between<br /><pre>
h2. Foo & Bar & Something
Something
</pre><br />also results in wrong rendering</p>
<p>regards</p> Redmine - Defect #3910: Trac to Redmine wiki migration problemshttps://www.redmine.org/issues/3910?journal_id=145222010-02-19T16:07:04Ztdev .
<ul></ul><p>this problem is still present. I have fixed the code a bit to convert headers with whitespaces in front correctly:</p>
<p>open file lib/tasks/migrate_from_trac.rake</p>
<p>and replace<br /><pre>
text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
</pre><br />with<br /><pre>
text = text.gsub(/(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
</pre></p> Redmine - Defect #3910: Trac to Redmine wiki migration problemshttps://www.redmine.org/issues/3910?journal_id=264222011-03-15T10:55:48ZCamille NERON
<ul></ul><p>Kamil . wrote:</p>
<blockquote>
<p>Some wiki formattings are well converted, bot some are not (which is very frustrating...)<br />Examples:<br />1) Links conversion:<br />- In Trac the syntax for "subsites" is: FooBar/LazyFox.<br />In redmine now it is converted to FooBarLazyFox but is not "visible" as a subsite</p>
<p>- In Trac the syntax for url with description is: [WikiSite/WikiSubSite here is the description]<br />This should be converted to: <a class="wiki-page new" href="https://www.redmine.org/projects/redmine/wiki/WikiSite_WikiSubSite">here is the description</a></p>
</blockquote>
<p>to fix the issue wiki link, add this regex : <br /><pre>
text = text.gsub(/\[([^\s\]]+)\s(.*)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}
</pre></p>
<p>after :</p>
<pre>
# 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(',./?;|:')}]]"}
</pre> Redmine - Defect #3910: Trac to Redmine wiki migration problemshttps://www.redmine.org/issues/3910?journal_id=265502011-03-17T14:13:07ZEtienne Massip
<ul><li><strong>Category</strong> set to <i>Importers</i></li></ul> Redmine - Defect #3910: Trac to Redmine wiki migration problemshttps://www.redmine.org/issues/3910?journal_id=362282012-02-21T21:16:35ZLeo Shklovskii
<ul></ul><p>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.</p>
<p>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:</p>
<pre>
# Titles
text = text.gsub(/(\=+)\s+([^=]+)\s+(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
</pre>