Defect #3276

Incorrect handling of anchors in Wiki to HTML export

Added by Mihail Manuylov over 8 years ago. Updated about 6 years ago.

Status:ClosedStart date:2009-04-30
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Wiki
Target version:1.2.2
Resolution:Fixed Affected version:0.8.3

Description

Here is my conf: Postgresql 8.3.7-1; Ruby 1.8.7; Rails 2.3.2; Redmine 0.8.3

The problem is when you export Wiki page to HTML all local anchor link are converted to html links. For example (space between [ and ] puts for notextile):

Wiki

[ [Wiki_page_name#some_anchor|link_text] ]

HTML
<p><a href="Wiki_page_name.html" class="wiki-page">link_text</a></p>

This conversion makes link unreachable.

After changing :wiki_links => :local on :wiki_links => :anchor in /app/views/wiki/export.rhtml anchors link starts convert to

<p><a href="#Wiki_page_name" class="wiki-page">link_text</a></p>

After changing

      format_wiki_link = Proc.new {|project, title, anchor| "##{title}" }

to
      format_wiki_link = Proc.new {|project, title, anchor| "##{anchor}" }

in /app/helpers/application_helper.rb converstion works fine.

1_raw_wiki.txt Magnifier - Raw wiki text (7.34 KB) Mihail Manuylov, 2009-05-12 05:15

2_export.html Magnifier - HTML export for :wiki_links => :anchor in /app/views/wiki/export.rhtml (8.24 KB) Mihail Manuylov, 2009-05-12 05:15

3_expected_export.html Magnifier - Expected HTML export (8.25 KB) Mihail Manuylov, 2009-05-12 05:15


Related issues

Duplicated by Redmine - Defect #9064: Broken internal links in export wiki to html Closed 2011-08-16

Associated revisions

Revision 7558
Added by Etienne Massip about 6 years ago

Use local links in wiki pages when possible (#3276).

Revision 7559
Added by Etienne Massip about 6 years ago

Merged r7558 from trunk (#3276).

History

#1 Updated by Jean-Philippe Lang over 8 years ago

I'm not sure to understand your problem.
If you're exporting a single wiki page, links to other pages needs to point to another HTML file. Of course, if this page was not exported, the link is unreachable.
Maybe you could attach a full example (raw text, HTML export and expected HTML export).

#2 Updated by Mihail Manuylov over 8 years ago

My problem is converting local links which points to local anchors in the same HTML file.

#3 Updated by Etienne Massip about 6 years ago

  • Target version set to Candidate for next minor release

#4 Updated by Etienne Massip about 6 years ago

  • Status changed from New to Resolved
  • Target version changed from Candidate for next minor release to 1.2.2
  • Resolution set to Fixed

Should be fixed in trunk with r7558.

#5 Updated by Jean-Philippe Lang about 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF