lib/showoff.rb in showoff-0.17.0 vs lib/showoff.rb in showoff-0.17.1
- old
+ new
@@ -519,10 +519,12 @@
item.children.before(Nokogiri::HTML::DocumentFragment.parse(frag))
end
# Process links
doc.css('a').each do |link|
+ next unless link.include? 'href'
+ next unless link.include? 'class'
next if link['href'].start_with? '#'
next if link['class'].split.include? 'processed' rescue nil
# If these are glossary links, populate the notes/handouts sections
if link['href'].start_with? 'glossary://'
@@ -1014,11 +1016,11 @@
path = filename.chomp('.md') # TODO: I don't know why we do this silly thing
begin
data << process_markdown(path, section, File.read(filename), opts)
rescue Errno::ENOENT => e
@logger.error e.message
- data << process_markdown(path, section, "!SLIDE\n# Missing File!\n## #{fname}", opts)
+ data << process_markdown(path, section, "!SLIDE\n# Missing File!\n## #{filename}", opts)
end
end
# I don't know what this part was supposed to do
# if section =~ /^#/
@@ -1764,9 +1766,11 @@
data
end
end
rescue NoMethodError => e
@logger.warn "Invalid object #{what} requested."
+ @logger.warn e.message
+ @logger.debug e.backtrace.join("\n")
raise Sinatra::NotFound
end
end
not_found do