mirror of https://github.com/freeCodeCamp/devdocs
Enabled by default in FileScraperpull/15/head
parent
9089d03211
commit
24347f312b
@ -0,0 +1,16 @@
|
||||
module Docs
|
||||
class CleanLocalUrlsFilter < Filter
|
||||
def call
|
||||
if base_url.host == 'localhost'
|
||||
css('img[src^="http://localhost"]', 'iframe[src^="http://localhost"]').remove
|
||||
|
||||
css('a[href^="http://localhost"]').each do |node|
|
||||
node.name = 'span'
|
||||
node.remove_attribute 'href'
|
||||
end
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue