@@ -713,7 +713,7 module ApplicationHelper | |||
|
713 | 713 | item = strip_tags(content).strip |
|
714 | 714 | anchor = item.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-') |
|
715 | 715 | @parsed_headings << [level, anchor, item] |
|
716 |
"<h#{level} #{attrs} |
|
|
716 | "<a name=\"#{anchor}\"></a>\n<h#{level} #{attrs}>#{content}<a href=\"##{anchor}\" class=\"wiki-anchor\">¶</a></h#{level}>" | |
|
717 | 717 | end |
|
718 | 718 | end |
|
719 | 719 |
@@ -526,6 +526,13 EXPECTED | |||
|
526 | 526 | assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(raw).gsub(%r{[\r\n\t]}, '') |
|
527 | 527 | end |
|
528 | 528 | |
|
529 | def test_headings | |
|
530 | raw = 'h1. Some heading' | |
|
531 | expected = %|<a name="Some-heading"></a>\n<h1 >Some heading<a href="#Some-heading" class="wiki-anchor">¶</a></h1>| | |
|
532 | ||
|
533 | assert_equal expected, textilizable(raw) | |
|
534 | end | |
|
535 | ||
|
529 | 536 | def test_table_of_content |
|
530 | 537 | raw = <<-RAW |
|
531 | 538 | {{toc}} |
General Comments 0
You need to be logged in to leave comments.
Login now