Defect #42
closedissue URL in repository comment break
0%
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!
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
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}