lib/brief/document/rendering.rb in brief-1.2.0 vs lib/brief/document/rendering.rb in brief-1.3.0
- old
+ new
@@ -17,15 +17,15 @@
HeadingWrapper
end
def renderer
@renderer ||= begin
- r = renderer_class.new(:tables => true,
- :autolink => true,
- :gh_blockcode => true,
- :fenced_code_blocks => true,
- :footnotes => true)
+ r = renderer_class.new(tables: true,
+ autolink: true,
+ gh_blockcode: true,
+ fenced_code_blocks: true,
+ footnotes: true)
::Redcarpet::Markdown.new(r)
end
end
end
@@ -34,11 +34,11 @@
#
# They will first be put through a Nokogiri processor pipeline
# which allows us to wrap things in section containers, apply data
# attributes, and other things to the HTML so that the output HTML retains its
# relationship to the underlying data and document structure.
- def to_html(options={})
+ def to_html(options = {})
if options[:wrap] == false
unwrapped_html
else
wrapper = options.fetch(:wrapper, 'div')
"<#{ wrapper } data-brief-model='#{ model_class.type_alias }' data-brief-path='#{ relative_path_identifier }'>#{ unwrapped_html }</#{wrapper}>"
@@ -57,11 +57,9 @@
def renderer
@renderer ||= self.class.renderer
end
- def renderer=(value)
- @renderer = value
- end
+ attr_writer :renderer
end
end
end