Defect #7781

TOC links do not work in Chrome

Added by Sam Nguyen almost 9 years ago. Updated almost 9 years ago.

Status:ClosedStart date:2011-03-04
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Wiki
Target version:-
Resolution:Invalid Affected version:1.1.1

Description

This line generates the Wiki headers in helpers/application_helper.rb:698 (v1.1.1, upgraded from a 1.0.4 installation)

    "<h#{level} #{attrs} id=\"#{anchor}\" >#{content}<a href=\"##{anchor}\" class=\"wiki-anchor\">&para;</a></h#{level}>" 

The problem is that the attrs variable has an id attribute, so the element has 2 id attributes. In Chrome, the 2nd id is discarded which makes the TOC links unusable.

  <h1 id="bfheader-e3fffad18eade3d08eeb5405c650e5b0" id="Web-Backend-API">Web Backend API
  <a href="#Web-Backend-API" class="wiki-anchor">&para;</a></h1> 

You can work around this by either rearranging the order of attrs and id="anchor" in the <h> tag, or removing the #{attrs} @ completely.

(BTW I am using the Markdown Extra wiki formatting plugin)

History

#1 Updated by Etienne Massip almost 9 years ago

  • Target version set to Candidate for next minor release

#2 Updated by Felix Schäfer almost 9 years ago

Sam Nguyen wrote:

(BTW I am using the Markdown Extra wiki formatting plugin)

Could you try it with the native textile formatter? The demo site should be sufficient for that. If you can't reproduce it there, it's rather a problem of the markdown plugin.

#3 Updated by Etienne Massip almost 9 years ago

  • Target version deleted (Candidate for next minor release)

#4 Updated by Sam Nguyen almost 9 years ago

  • Status changed from New to Resolved

Indeed, this appears to be a problem with the native wiki formatter. I had no issue on the demo site.

http://demo.redmine.org/projects/wiki-toc-test/wiki/Wiki#Wiki

#5 Updated by Etienne Massip almost 9 years ago

  • Status changed from Resolved to Closed
  • Resolution set to Invalid

Thanks.

Also available in: Atom PDF