Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rename relrenderer

This was sorta a weird extension I wrote to add link relations, I'm not really
using it anywhere, plus it was doing that AND building the outline, so
now it's just outline renderer.
  • Loading branch information...
commit f656fdfbb3db6bd21acb13a17a9a11fcd0b99482 1 parent 4f0ff76
@steveklabnik authored
Showing with 2 additions and 6 deletions.
  1. +2 −6 lib/source_file.rb
View
8 lib/source_file.rb
@@ -28,7 +28,7 @@ def link(link, title, content)
end
end
-class RelRenderer < Redcarpet::Render::HTML
+class OutlineRenderer < Redcarpet::Render::HTML
attr_accessor :outline
def initialize
@@ -36,10 +36,6 @@ def initialize
super
end
- def link(link, title, content)
- "<a href='#{link}' rel='#{title}'>#{content}</a>"
- end
-
def header(text, header_level)
text_slug = text.to_s.gsub(/\W/, "_").downcase
@@ -94,7 +90,7 @@ def initialize(name)
end
if content =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
- renderer = RelRenderer.new
+ renderer = OutlineRenderer.new
r = Redcarpet::Markdown.new(renderer, :fenced_code_blocks => true)
self.content = r.render($')
self.outline = renderer.outline
Please sign in to comment.
Something went wrong with that request. Please try again.