Download images by default

Rel: #633
pull/631/merge
Thibaut Courouble 8 years ago
parent df2af95a54
commit f7580a8b52

@ -42,6 +42,7 @@ module Docs
self.text_filters = FilterStack.new
html_filters.push 'apply_base_url', 'container', 'clean_html', 'normalize_urls', 'internal_urls', 'normalize_paths'
text_filters.push 'images' # ensure the images filter runs after all html filters
text_filters.push 'inner_html', 'clean_text', 'attribution'
def initialize

@ -10,6 +10,8 @@ module Docs
end
def call
return doc if context[:download_images] == false
@@cache ||= {}
doc.css('img[src]').each do |node|

@ -6,7 +6,7 @@ module Docs
params[:raw] = 1
params[:macros] = 1
html_filters.push 'mdn/clean_html', 'images'
html_filters.push 'mdn/clean_html'
text_filters.insert_before 'attribution', 'mdn/contribute_link'
options[:trailing_slash] = false

Loading…
Cancel
Save