Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings #417

Merged
merged 2 commits into from
May 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/gollum-lib/filter/toc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def generate_anchor_name(header)
# Creates an anchor element with the given name and adds it before
# the given header element.
def add_anchor_to_header(header, name)
a = Nokogiri::XML::Node.new('a', @doc)
a = Nokogiri::XML::Node.new('a', @doc.document)
a['class'] = 'anchor'
a['id'] = name
a['href'] = "##{name}"
Expand All @@ -143,17 +143,17 @@ def add_entry_to_toc(header, name)

if @tail_level < level
while @tail_level < level
list = Nokogiri::XML::Node.new('ul', @doc)
list = Nokogiri::XML::Node.new('ul', @doc.document)
@tail.add_child(list)
@tail = list.add_child(Nokogiri::XML::Node.new('li', @doc))
@tail = list.add_child(Nokogiri::XML::Node.new('li', @doc.document))
@tail_level += 1
end
else
while @tail_level > level
@tail = @tail.parent.parent
@tail_level -= 1
end
@tail = @tail.parent.add_child(Nokogiri::XML::Node.new('li', @doc))
@tail = @tail.parent.add_child(Nokogiri::XML::Node.new('li', @doc.document))
end

# % -> %25 so anchors work on Firefox. See issue #475
Expand Down
2 changes: 1 addition & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# external
require 'rubygems'
require 'shoulda'
require 'mocha/setup'
require 'mocha/test_unit'
require 'minitest/reporters'
require 'twitter_cldr'
require 'tempfile'
Expand Down