diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index 9d0a7068..5bc93f3c 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -14,7 +14,6 @@ require 'gollum/frontend/views/editable' # require 'gollum/frontend/app' # Precious::App.set(:wiki_options, { # :universal_toc => false, -# :header_hashtags => true # } # # See the wiki.rb file for more details on wiki options diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb index 4e05f634..28a53d45 100644 --- a/lib/gollum/markup.rb +++ b/lib/gollum/markup.rb @@ -83,7 +83,7 @@ module Gollum anchor['class'] = 'anchor' anchor['id'] = id anchor['href'] = '#' + id - h.child.before(anchor) + h.add_child(anchor) # Build TOC toc ||= Nokogiri::XML::Node.new('ul', doc) diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index a77d8c7c..517ace93 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -139,9 +139,6 @@ module Gollum # site. # options - Optional Hash: # :universal_toc - Table of contents on all pages. Default: false - # :header_hashtags - Show links to headers. Default: true - # (Pages may be rendered slightly faster without - # the toc and hashtags) # :base_path - String base path for all Wiki links. # Default: "/" # :page_class - The page Class. Default: Gollum::Page @@ -175,7 +172,6 @@ module Gollum @history_sanitization = options[:history_sanitization] || self.class.history_sanitization @universal_toc = options.fetch(:universal_toc, false) - @header_hashtags = options.fetch(:header_hashtags, true) end # Public: check whether the wiki's git repo exists on the filesystem. @@ -542,9 +538,6 @@ module Gollum # Toggles display of universal table of contents attr_reader :universal_toc - # Create hashtag link for headers to jump to sections - attr_reader :header_hashtags - # Normalize the data. # # data - The String data to be normalized. diff --git a/test/test_markup.rb b/test/test_markup.rb index bf4e64c9..41539de9 100644 --- a/test/test_markup.rb +++ b/test/test_markup.rb @@ -6,7 +6,7 @@ context "Markup" do @path = testpath("examples/test.git") FileUtils.rm_rf(@path) Grit::Repo.init_bare(@path) - Gollum::Wiki.default_options = {:header_hashtags => false, :universal_toc => false} + Gollum::Wiki.default_options = {:universal_toc => false} @wiki = Gollum::Wiki.new(@path) end @@ -556,14 +556,15 @@ np.array([[2,2],[1,3]],np.float) test "id with prefix ok" do content = "h2(example#wiki-foo). xxxx" - output = %(
1 footnote
" compare(content, output, :textile) end @@ -601,11 +602,11 @@ np.array([[2,2],[1,3]],np.float) ######################################################################### test "asciidoc header" do - compare("= Book Title\n\n== Heading", 'Bilbo Baggins/ + assert page.formatted_data =~ %r{
Bilbo Baggins} assert_equal 'Bilbo-Baggins.md', page.path assert_equal :markdown, page.format assert_equal @wiki.repo.commits.first.id, page.version.id diff --git a/test/test_wiki.rb b/test/test_wiki.rb index 93e8622a..3ec25a04 100644 --- a/test/test_wiki.rb +++ b/test/test_wiki.rb @@ -92,14 +92,14 @@ end context "Wiki page previewing" do setup do @path = testpath("examples/lotr.git") - Gollum::Wiki.default_options = {:header_hashtags => false, :universal_toc => false} + Gollum::Wiki.default_options = {:universal_toc => false} @wiki = Gollum::Wiki.new(@path) end test "preview_page" do page = @wiki.preview_page("Test", "# Bilbo", :markdown) assert_equal "# Bilbo", page.raw_data - assert_equal "