プロジェクト

全般

プロフィール

Vote #67180

完了

External links not correctly displayed in Wiki TOC

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Text formatting_26
対象バージョン:
開始日:
2010/05/05
期日:
進捗率:

100%

予定工数:
category_id:
26
version_id:
19
issue_org_id:
5445
author_id:
13923
assigned_to_id:
5
comments:
12
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
17
ステータス-->[Closed]

説明

{{toc}}

h1. "Link1":http://www.redmine.org/

h2. "Link2":http://www.redmine.org/

h1. "Link3":http://www.redmine.org/

!toc_external_link.jpg!


journals

Not sure how complex the problem is, but I'd wager it's more a small-ish parser/filter issue that could be included in version:0.9.5.
--------------------------------------------------------------------------------
Fixed
--------------------------------------------------------------------------------
My variant
--------------------------------------------------------------------------------
あああ
--------------------------------------------------------------------------------
Can someone add some tests for these patches? The wiki syntax is a high risk area of code and I want to make sure these changes don't break anything.
--------------------------------------------------------------------------------
Yuki version with pre/post strings detected in LINK_RE regex, and a unit test. Maybe this test should be moved into test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb ?
--------------------------------------------------------------------------------
Fixed in r3786. Thank you for adding some tests for this bug, it will make it easier to prevent this from reoccurring later.
--------------------------------------------------------------------------------
Merged to 0.9-stable for release.
--------------------------------------------------------------------------------
r3786 has broken my installation:

<pre>
Processing WelcomeController#index (for 192.168.192.168 at 2010-06-22 14:34:00) [GET]
Parameters: {"action"=>"index", "controller"=>"welcome"}
Rendering template within layouts/base
Rendering welcome/index

ActionView::TemplateError (undefined method `+' for nil:NilClass) on line #23 of app/views/welcome/index.rhtml:
20: <% for project in @projects %>
21: <li>
22: <%= link_to h(project.name), :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>)
23: <%= textilizable project.short_description, :project => project %>
24: </li>
25: <% end %>
26: </ul>

lib/redmine/wiki_formatting/textile/formatter.rb:70:in `textile_p_withtoc'
lib/redmine/wiki_formatting/textile/formatter.rb:70:in `gsub!'
lib/redmine/wiki_formatting/textile/formatter.rb:70:in `textile_p_withtoc'
lib/redcloth3.rb:711:in `call'
lib/redcloth3.rb:711:in `block_textile_prefix'
lib/redcloth3.rb:659:in `call'
lib/redcloth3.rb:659:in `blocks'
lib/redcloth3.rb:658:in `each'
lib/redcloth3.rb:658:in `blocks'
lib/redcloth3.rb:633:in `collect'
lib/redcloth3.rb:633:in `blocks'
lib/redcloth3.rb:304:in `to_html'
lib/redmine/wiki_formatting/textile/formatter.rb:38:in `to_html'
lib/redmine/wiki_formatting.rb:54:in `to_html'
app/helpers/application_helper.rb:421:in `textilizable'
app/views/welcome/index.rhtml:23:in `_run_rhtml_app47views47welcome47index46rhtml'
app/views/welcome/index.rhtml:20:in `each'
app/views/welcome/index.rhtml:20:in `_run_rhtml_app47views47welcome47index46rhtml'

Rendering /opt/redmine/public/500.html (500 Internal Server Error)
</pre>

script/about:

<pre>
Ruby version 1.8.7 (i486-linux)
RubyGems version 1.3.7
Rack version 1.0
Rails version 2.3.5
Active Record version 2.3.5
Active Resource version 2.3.5
Action Mailer version 2.3.5
Active Support version 2.3.5
Application root /path/to/redmine
Environment production
Database adapter mysql
Database schema version 20100313171051

About your Redmine plugins
Redmine Whining plugin 0.0.3
Redmine Opensearch plugin 0.1
Thumbnails plugin 0.1.1
Redmine Status Updates 0.1.1
Redmine Request Tracker link 0.1.0
Redmine Graphs plugin 0.1.0
Issue Resources 0.2.0
Redmine Bugcloud plugin 0.0.2.1
ezFAQ plugin 0.3.5
Redmine Favicon plugin 0.1
Redmine link 0.1.0
Redmine Code Review plugin 0.3.1
Redmine Local Avatars plugin 0.0.2
Redmine Issues Group plugin 0.1.7
Redmine Todo Lists plugin 0.0.3.9
Redmine My Widgets plugin 0.1.0
Redmine ezSummary plugin 0.0.1
Redmine Charts 0.1.0
Redmine Question plugin 0.3.0
</pre>

Maybe it die while textilizing the short description of one of the last projects in my installation:

<pre>
h2. "Project Name !/attachments/1234/logo_small.gif! !/attachments/5678/logo_2.png!":/projects/projectname/issues

| "New Issue here":mailto:emissionaddress@mycompany.com?body=Project:projectname |
| "Create issue in Category A":mailto:emissionaddress@mycompany.com?body=Project:projectname%0ACategory:A |
</pre>

What am I doing wrong?
--------------------------------------------------------------------------------
Update:
attachment:formatter.rb.diff patch works fine, except it actually cant remove <pre>!attachedimage!, version:smth, attachment:file</pre>link tags from toc, only <pre>"Link name":http://link.address.com</pre> , but commited r3786 patch brakes system at every place where it tries to textilize links. For example, MyController displays page, but ProjectsController falls in 500.html..
--------------------------------------------------------------------------------
Confirmed.
So I updated the patch.
--------------------------------------------------------------------------------
Roland Discein:

I've applied Yuki Kita's update and also a small change to remove the textile image links @!/path/img.gif!@ from the table of contents generator.
--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリText formatting_26 にセット
  • 対象バージョン0.9.5_19 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0