From: Jean-Philippe Lang Date: Sat, 18 Oct 2008 11:25:27 +0000 (+0000) Subject: Fixed: textile footnotes no longer work after r1113 (#974). X-Git-Tag: 0.8.0-RC1~156 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ff449b197f2813412b4e54c287b2b16cd3299ea8;p=redmine.git Fixed: textile footnotes no longer work after r1113 (#974). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1941 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index 6f4fc9863..6815ecb7c 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -272,7 +272,7 @@ class RedCloth3 < String @shelf = [] textile_rules = [:refs_textile, :block_textile_table, :block_textile_lists, :block_textile_prefix, :inline_textile_image, :inline_textile_link, - :inline_textile_code, :inline_textile_span] + :inline_textile_code, :inline_textile_span, :glyphs_textile] markdown_rules = [:refs_markdown, :block_markdown_setext, :block_markdown_atx, :block_markdown_rule, :block_markdown_bq, :block_markdown_lists, :inline_markdown_reflink, :inline_markdown_link] @@ -684,7 +684,7 @@ class RedCloth3 < String alias textile_h6 textile_p def textile_fn_( tag, num, atts, cite, content ) - atts << " id=\"fn#{ num }\"" + atts << " id=\"fn#{ num }\" class=\"footnote\"" content = "#{ num } #{ content }" atts = shelve( atts ) if atts "\t#{ content }

" @@ -1010,7 +1010,7 @@ class RedCloth3 < String def glyphs_textile( text, level = 0 ) if text !~ HASTAG_MATCH - pgl text + #pgl text footnote_ref text else codepre = 0 diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index e7a1c60b1..1cc437de0 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -163,6 +163,7 @@ li p {margin-top: 0;} div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} p.breadcrumb { font-size: 0.9em; margin: 4px 0 4px 0;} p.subtitle { font-size: 0.9em; margin: -6px 0 12px 0; font-style: italic; } +p.footnote { font-size: 0.9em; margin-top: 0px; margin-bottom: 0px; } fieldset#filters, fieldset#date-range { padding: 0.7em; margin-bottom: 8px; } fieldset#filters p { margin: 1.2em 0 0.8em 2px; } @@ -272,6 +273,7 @@ input#time_entry_comments { width: 90%;} #attachments_fields input[type=text] {margin-left: 8px; } +div.attachments { margin-top: 12px; } div.attachments p { margin:4px 0 2px 0; } div.attachments img { vertical-align: middle; } div.attachments span.author { font-size: 0.9em; color: #888; } diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index cbdba5971..c3e8ca2d7 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -219,6 +219,21 @@ class ApplicationHelperTest < HelperTestCase assert_equal '

Dashes: ---

', textilizable('Dashes: ---') end + def test_footnotes + raw = <<-RAW +This is some text[1]. + +fn1. This is the foot note +RAW + + expected = <<-EXPECTED +

This is some text1.

+

1 This is the foot note

+EXPECTED + + assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '') + end + def test_table_of_content raw = <<-RAW {{toc}}