provide access to the parsed Nokogiri document fragment when rendering marked up content.
This commit is contained in:
@@ -44,7 +44,12 @@ module Gollum
|
||||
end
|
||||
data = process_tags(data)
|
||||
data = process_code(data)
|
||||
data = sanitize.clean!(data) if sanitize
|
||||
if sanitize || block_given?
|
||||
doc = Nokogiri::HTML::DocumentFragment.parse(data)
|
||||
doc = sanitize.clean_node!(doc) if sanitize
|
||||
yield doc if block_given?
|
||||
data = doc_to_html(doc)
|
||||
end
|
||||
data = process_tex(data)
|
||||
data.gsub!(/<p><\/p>/, '')
|
||||
data
|
||||
|
||||
+2
-2
@@ -132,8 +132,8 @@ module Gollum
|
||||
# Public: The formatted contents of the page.
|
||||
#
|
||||
# Returns the String data.
|
||||
def formatted_data
|
||||
@blob && @wiki.markup_class.new(self).render(historical?)
|
||||
def formatted_data(&block)
|
||||
@blob && @wiki.markup_class.new(self).render(historical?, &block)
|
||||
end
|
||||
|
||||
# Public: The format of the page.
|
||||
|
||||
Reference in New Issue
Block a user