File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
lib/html_pipeline/node_filter Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change 44
55class HTMLPipeline
66 class NodeFilter
7+ # HTML Filter for replacing relative and root relative image URLs with
8+ # fully qualified URLs
9+ #
10+ # This is useful if an image is root relative but should really be going
11+ # through a cdn, or if the content for the page assumes the host is known
12+ # i.e. scraped webpages and some RSS feeds.
13+ #
14+ # Context options:
15+ # :image_base_url - Base URL for image host for root relative src.
16+ # :image_subpage_url - For relative src.
17+ #
18+ # This filter does not write additional information to the context.
19+ # Note: This filter would need to be run before AssetProxyFilter.
720 class AbsoluteSourceFilter < NodeFilter
821 SELECTOR = Selma ::Selector . new ( match_element : "img" )
922
1023 def selector
1124 SELECTOR
1225 end
1326
14- # HTML Filter for replacing relative and root relative image URLs with
15- # fully qualified URLs
16- #
17- # This is useful if an image is root relative but should really be going
18- # through a cdn, or if the content for the page assumes the host is known
19- # i.e. scraped webpages and some RSS feeds.
20- #
21- # Context options:
22- # :image_base_url - Base URL for image host for root relative src.
23- # :image_subpage_url - For relative src.
24- #
25- # This filter does not write additional information to the context.
26- # This filter would need to be run before CamoFilter.
2727 def handle_element ( element )
2828 src = element [ "src" ]
2929 return if src . nil? || src . empty?
You can’t perform that action at this time.
0 commit comments