HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/gems/ruby-2.7.4/doc/loofah-2.12.0/ri/Loofah/Scrubbers/cdesc-Scrubbers.ri
U:RDoc::NormalModule[iI"Scrubbers:ETI"Loofah::Scrubbers;T0o:RDoc::Markup::Document:@parts[o;;[/o:RDoc::Markup::Paragraph;[I"ALoofah provides some built-in scrubbers for sanitizing with ;TI";HTML5lib's safelist and for accomplishing some common ;TI"transformation tasks.;To:RDoc::Markup::BlankLineS:RDoc::Markup::Heading:
leveli:	textI".Loofah::Scrubbers::Strip / scrub!(:strip);T@o;	;[I"S+:strip+ removes unknown/unsafe tags, but leaves behind the pristine contents:;T@o:RDoc::Markup::Verbatim;[I"Sunsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
;TI"1Loofah.fragment(unsafe_html).scrub!(:strip)
;TI"==> "ohai! <div>div is safe</div> but foo is <b>not</b>"
;T:@format0S;;i;
I".Loofah::Scrubbers::Prune / scrub!(:prune);T@o;	;[I"X+:prune+ removes unknown/unsafe tags and their contents (including their subtrees):;T@o;;[I"Sunsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
;TI"1Loofah.fragment(unsafe_html).scrub!(:prune)
;TI"(=> "ohai! <div>div is safe</div> "
;T;0S;;i;
I"0Loofah::Scrubbers::Escape / scrub!(:escape);T@o;	;[I"H+:escape+ performs HTML entity escaping on the unknown/unsafe tags:;T@o;;[I"Sunsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
;TI"2Loofah.fragment(unsafe_html).scrub!(:escape)
;TI"`=> "ohai! <div>div is safe</div> &lt;foo&gt;but foo is &lt;b&gt;not&lt;/b&gt;&lt;/foo&gt;"
;T;0S;;i;
I"6Loofah::Scrubbers::Whitewash / scrub!(:whitewash);T@o;	;[	I"B+:whitewash+ removes all comments, styling and attributes in ;TI"Faddition to doing markup-fixer-uppery and pruning unsafe tags. I ;TI"Elike to call this "whitewashing", since it's like putting a new ;TI"Blayer of paint on top of the HTML input to make it look nice.;T@o;;[I"emessy_markup = "ohai! <div id='foo' class='bar' style='margin: 10px'>div with attributes</div>"
;TI"6Loofah.fragment(messy_markup).scrub!(:whitewash)
;TI"/=> "ohai! <div>div with attributes</div>"
;T;0o;	;[
I"AOne use case for this scrubber is to clean up HTML that was ;TI"Ccut-and-pasted from Microsoft Word into a WYSIWYG editor or a ;TI"Drich text editor. Microsoft's software is famous for injecting ;TI"Call kinds of cruft into its HTML output. Who needs that crap? ;TI"Certainly not me.;T@S;;i;
I"4Loofah::Scrubbers::NoFollow / scrub!(:nofollow);T@o;	;[I"=+:nofollow+ adds a rel="nofollow" attribute to all links;T@o;;[I"dlink_farmers_markup = "ohai! <a href='http://www.myswarmysite.com/'>I like your blog post</a>"
;TI"<Loofah.fragment(link_farmers_markup).scrub!(:nofollow)
;TI"`=> "ohai! <a href='http://www.myswarmysite.com/' rel="nofollow">I like your blog post</a>"
;T;0S;;i;
I"4Loofah::Scrubbers::NoOpener / scrub!(:noopener);T@o;	;[I"=+:noopener+ adds a rel="noopener" attribute to all links;T@o;;[I"dlink_farmers_markup = "ohai! <a href='http://www.myswarmysite.com/'>I like your blog post</a>"
;TI"<Loofah.fragment(link_farmers_markup).scrub!(:noopener)
;TI"`=> "ohai! <a href='http://www.myswarmysite.com/' rel="noopener">I like your blog post</a>"
;T;0S;;i;
I":Loofah::Scrubbers::Unprintable / scrub!(:unprintable);T@o;	;[I";+:unprintable+ removes unprintable Unicode characters.;T@o;;[I"Pmarkup = "<p>Some text with an unprintable character at the end\u2028</p>"
;TI"2Loofah.fragment(markup).scrub!(:unprintable)
;TI"D=> "<p>Some text with an unprintable character at the end</p>"
;T;0o;	;[I"_You may not be able to see the unprintable character in the above example, but there is a ;TI"^U+2028 character right before the closing </p> tag. These characters can cause issues if ;TI"Fthe content is ever parsed by JavaScript - more information here:;T@o;;[I":http://timelessrepo.com/json-isnt-a-javascript-subset;T;0:
@fileI"lib/loofah/scrubbers.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[[U:RDoc::Constant[iI"MAP;TI"Loofah::Scrubbers::MAP;T:public0o;;[o;	;[I"fA hash that maps a symbol (like +:prune+) to the appropriate Scrubber (Loofah::Scrubbers::Prune).;T;@k;0@k@cRDoc::NormalModule0[[[I"
class;T[[;[[I"scrubber_symbols;TI"lib/loofah/scrubbers.rb;T[:protected[[:private[[I"
instance;T[[;[[;[[;[[[U:RDoc::Context::Section[i0o;;[;0;0[@kI"Loofah;T@w