Project

General

Profile

Actions

Defect #42

closed

issue URL in repository comment break

Added by Peer Allan over 17 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

If we have a comment in subversion like this:

issue #245; fixed the problem

The URL for the link includes the semi-colon and the link text does not:

issue <a href="/issues/show/281;">#281</a>

Clicking on these links generates a 404 error.

Thanks!

Actions #1

Updated by Pavol Murin over 17 years ago

Fix: it is necessary to add a space after the link, as the word
boundary might be a character. I fixed it in the following way:

change in app/helpers/application_helper.rb:

line 122:
text = text.gsub(/#(\d+)(?=\b)/) {|m|
"\"##{$1}\":" + url_for(:controller =>
'issues', :action => 'show', :id => $1) }

to:
text = text.gsub(/#(\d+)(?=\b)/) {|m|
"\"##{$1}\":" + url_for(:controller =>
'issues', :action => 'show', :id => $1) + " " }

and line 127:
text = text.gsub(/r(\d+)(?=\b)/) {|m|
"\"r#{$1}\":" + url_for(:controller =>
'repositories', :action => 'revision', :id => @project.id,
:rev => $1) } if Herve Harster

to:

text = text.gsub(/r(\d+)(?=\b)/) {|m|
"\"r#{$1}\":" + url_for(:controller =>
'repositories', :action => 'revision', :id => @project.id,
:rev => $1) + " " } if @project

muro

Actions #2

Updated by Jean-Philippe Lang over 17 years ago

Fix committed.
Instead of generating textile links, html links are directly
generated.
eg.
text = text.gsub(/#(\d+)(?=\b)/) {|m| link_to "##{$1}",
:controller => 'issues', :action => 'show', :id => $1}

Actions

Also available in: Atom PDF