packwerk-haml 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +75 -0
  4. data/Gemfile +22 -0
  5. data/Gemfile.lock +190 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +32 -0
  8. data/Rakefile +16 -0
  9. data/lib/packwerk_haml/parser.rb +64 -0
  10. data/lib/packwerk_haml/version.rb +6 -0
  11. data/lib/packwerk_haml.rb +8 -0
  12. data/packwerk-haml.gemspec +40 -0
  13. data/sig/packwerk/haml.rbs +4 -0
  14. data/sorbet/config +4 -0
  15. data/sorbet/rbi/annotations/.gitattributes +1 -0
  16. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  17. data/sorbet/rbi/annotations/activesupport.rbi +136 -0
  18. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  19. data/sorbet/rbi/gems/.gitattributes +1 -0
  20. data/sorbet/rbi/gems/actionview@7.1.1.rbi +15004 -0
  21. data/sorbet/rbi/gems/activesupport@7.1.1.rbi +18784 -0
  22. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  23. data/sorbet/rbi/gems/base64@0.1.1.rbi +172 -0
  24. data/sorbet/rbi/gems/better_html@2.0.2.rbi +529 -0
  25. data/sorbet/rbi/gems/bigdecimal@3.1.4.rbi +77 -0
  26. data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
  27. data/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi +11545 -0
  28. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +8 -0
  29. data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +90 -0
  30. data/sorbet/rbi/gems/crass@1.0.6.rbi +622 -0
  31. data/sorbet/rbi/gems/drb@2.1.1.rbi +1313 -0
  32. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  33. data/sorbet/rbi/gems/haml@6.2.3.rbi +1619 -0
  34. data/sorbet/rbi/gems/i18n@1.14.1.rbi +2325 -0
  35. data/sorbet/rbi/gems/json@2.6.3.rbi +1533 -0
  36. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  37. data/sorbet/rbi/gems/loofah@2.21.4.rbi +1021 -0
  38. data/sorbet/rbi/gems/m@1.6.2.rbi +257 -0
  39. data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
  40. data/sorbet/rbi/gems/minitest-focus@1.4.0.rbi +91 -0
  41. data/sorbet/rbi/gems/minitest@5.20.0.rbi +1509 -0
  42. data/sorbet/rbi/gems/mutex_m@0.1.2.rbi +91 -0
  43. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  44. data/sorbet/rbi/gems/nokogiri@1.15.4.rbi +7317 -0
  45. data/sorbet/rbi/gems/packwerk@3.1.0-752d37add96b9f4bf28492d7db152f6523b1d29c.rbi +2370 -0
  46. data/sorbet/rbi/gems/parallel@1.23.0.rbi +273 -0
  47. data/sorbet/rbi/gems/parser@3.2.2.4.rbi +7253 -0
  48. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  49. data/sorbet/rbi/gems/racc@1.7.1.rbi +161 -0
  50. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +8 -0
  51. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +716 -0
  52. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  53. data/sorbet/rbi/gems/rake@13.0.6.rbi +3042 -0
  54. data/sorbet/rbi/gems/rbi@0.1.1.rbi +2926 -0
  55. data/sorbet/rbi/gems/regexp_parser@2.8.2.rbi +3749 -0
  56. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  57. data/sorbet/rbi/gems/rubocop-ast@1.29.0.rbi +7075 -0
  58. data/sorbet/rbi/gems/rubocop-performance@1.19.1.rbi +3208 -0
  59. data/sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi +8 -0
  60. data/sorbet/rbi/gems/rubocop-sorbet@0.7.4.rbi +1442 -0
  61. data/sorbet/rbi/gems/rubocop@1.57.0.rbi +56753 -0
  62. data/sorbet/rbi/gems/ruby-lsp@0.2.4.rbi +11 -0
  63. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  64. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  65. data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +474 -0
  66. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  67. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
  68. data/sorbet/rbi/gems/tapioca@0.11.9.rbi +3498 -0
  69. data/sorbet/rbi/gems/temple@0.10.3.rbi +1738 -0
  70. data/sorbet/rbi/gems/thor@1.2.2.rbi +3965 -0
  71. data/sorbet/rbi/gems/tilt@2.3.0.rbi +925 -0
  72. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
  73. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  74. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  75. data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
  76. data/sorbet/rbi/gems/yarp@0.13.0.rbi +21646 -0
  77. data/sorbet/rbi/gems/zeitwerk@2.6.12.rbi +997 -0
  78. data/sorbet/tapioca/config.yml +13 -0
  79. data/sorbet/tapioca/require.rb +5 -0
  80. metadata +167 -0
@@ -0,0 +1,1021 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `loofah` gem.
5
+ # Please instead update this file by running `bin/tapioca gem loofah`.
6
+
7
+ # == Strings and IO Objects as Input
8
+ #
9
+ # The following methods accept any IO object in addition to accepting a string:
10
+ #
11
+ # - Loofah.html4_document
12
+ # - Loofah.html4_fragment
13
+ # - Loofah.scrub_html4_document
14
+ # - Loofah.scrub_html4_fragment
15
+ #
16
+ # - Loofah.html5_document
17
+ # - Loofah.html5_fragment
18
+ # - Loofah.scrub_html5_document
19
+ # - Loofah.scrub_html5_fragment
20
+ #
21
+ # - Loofah.xml_document
22
+ # - Loofah.xml_fragment
23
+ # - Loofah.scrub_xml_document
24
+ # - Loofah.scrub_xml_fragment
25
+ #
26
+ # - Loofah.document
27
+ # - Loofah.fragment
28
+ # - Loofah.scrub_document
29
+ # - Loofah.scrub_fragment
30
+ #
31
+ # That IO object could be a file, or a socket, or a StringIO, or anything that responds to +read+
32
+ # and +close+.
33
+ #
34
+ # source://loofah//lib/loofah.rb#5
35
+ module Loofah
36
+ class << self
37
+ # Shortcut for Loofah::HTML4::Document.parse(*args, &block)
38
+ #
39
+ # This method accepts the same parameters as Nokogiri::HTML4::Document.parse
40
+ #
41
+ # source://loofah//lib/loofah.rb#76
42
+ def document(*args, &block); end
43
+
44
+ # Shortcut for Loofah::HTML4::DocumentFragment.parse(*args, &block)
45
+ #
46
+ # This method accepts the same parameters as Nokogiri::HTML4::DocumentFragment.parse
47
+ #
48
+ # source://loofah//lib/loofah.rb#83
49
+ def fragment(*args, &block); end
50
+
51
+ # Shortcut for Loofah::HTML4::Document.parse(*args, &block)
52
+ #
53
+ # This method accepts the same parameters as Nokogiri::HTML4::Document.parse
54
+ #
55
+ # source://loofah//lib/loofah.rb#76
56
+ def html4_document(*args, &block); end
57
+
58
+ # Shortcut for Loofah::HTML4::DocumentFragment.parse(*args, &block)
59
+ #
60
+ # This method accepts the same parameters as Nokogiri::HTML4::DocumentFragment.parse
61
+ #
62
+ # source://loofah//lib/loofah.rb#83
63
+ def html4_fragment(*args, &block); end
64
+
65
+ # source://loofah//lib/loofah.rb#101
66
+ def html5_document(*args, &block); end
67
+
68
+ # source://loofah//lib/loofah.rb#108
69
+ def html5_fragment(*args, &block); end
70
+
71
+ # @return [Boolean]
72
+ #
73
+ # source://loofah//lib/loofah.rb#7
74
+ def html5_support?; end
75
+
76
+ # A helper to remove extraneous whitespace from text-ified HTML
77
+ #
78
+ # source://loofah//lib/loofah.rb#169
79
+ def remove_extraneous_whitespace(string); end
80
+
81
+ # Shortcut for Loofah::HTML4::Document.parse(string_or_io).scrub!(method)
82
+ #
83
+ # source://loofah//lib/loofah.rb#88
84
+ def scrub_document(string_or_io, method); end
85
+
86
+ # Shortcut for Loofah::HTML4::DocumentFragment.parse(string_or_io).scrub!(method)
87
+ #
88
+ # source://loofah//lib/loofah.rb#93
89
+ def scrub_fragment(string_or_io, method); end
90
+
91
+ # Shortcut for Loofah::HTML4::Document.parse(string_or_io).scrub!(method)
92
+ #
93
+ # source://loofah//lib/loofah.rb#88
94
+ def scrub_html4_document(string_or_io, method); end
95
+
96
+ # Shortcut for Loofah::HTML4::DocumentFragment.parse(string_or_io).scrub!(method)
97
+ #
98
+ # source://loofah//lib/loofah.rb#93
99
+ def scrub_html4_fragment(string_or_io, method); end
100
+
101
+ # source://loofah//lib/loofah.rb#113
102
+ def scrub_html5_document(string_or_io, method); end
103
+
104
+ # source://loofah//lib/loofah.rb#118
105
+ def scrub_html5_fragment(string_or_io, method); end
106
+
107
+ # Shortcut for Loofah.xml_document(string_or_io).scrub!(method)
108
+ #
109
+ # source://loofah//lib/loofah.rb#164
110
+ def scrub_xml_document(string_or_io, method); end
111
+
112
+ # Shortcut for Loofah.xml_fragment(string_or_io).scrub!(method)
113
+ #
114
+ # source://loofah//lib/loofah.rb#159
115
+ def scrub_xml_fragment(string_or_io, method); end
116
+
117
+ # Shortcut for Loofah::XML::Document.parse(*args, &block)
118
+ #
119
+ # This method accepts the same parameters as Nokogiri::XML::Document.parse
120
+ #
121
+ # source://loofah//lib/loofah.rb#147
122
+ def xml_document(*args, &block); end
123
+
124
+ # Shortcut for Loofah::XML::DocumentFragment.parse(*args, &block)
125
+ #
126
+ # This method accepts the same parameters as Nokogiri::XML::DocumentFragment.parse
127
+ #
128
+ # source://loofah//lib/loofah.rb#154
129
+ def xml_fragment(*args, &block); end
130
+ end
131
+ end
132
+
133
+ # source://loofah//lib/loofah/concerns.rb#125
134
+ module Loofah::DocumentDecorator
135
+ # source://loofah//lib/loofah/concerns.rb#126
136
+ def initialize(*args, &block); end
137
+ end
138
+
139
+ # source://loofah//lib/loofah/elements.rb#6
140
+ module Loofah::Elements; end
141
+
142
+ # source://loofah//lib/loofah/elements.rb#93
143
+ Loofah::Elements::BLOCK_LEVEL = T.let(T.unsafe(nil), Set)
144
+
145
+ # Elements that aren't block but should generate a newline in #to_text
146
+ #
147
+ # source://loofah//lib/loofah/elements.rb#90
148
+ Loofah::Elements::INLINE_LINE_BREAK = T.let(T.unsafe(nil), Set)
149
+
150
+ # source://loofah//lib/loofah/elements.rb#94
151
+ Loofah::Elements::LINEBREAKERS = T.let(T.unsafe(nil), Set)
152
+
153
+ # The following elements may also be considered block-level
154
+ # elements since they may contain block-level elements
155
+ #
156
+ # source://loofah//lib/loofah/elements.rb#76
157
+ Loofah::Elements::LOOSE_BLOCK_LEVEL = T.let(T.unsafe(nil), Set)
158
+
159
+ # source://loofah//lib/loofah/elements.rb#92
160
+ Loofah::Elements::STRICT_BLOCK_LEVEL = T.let(T.unsafe(nil), Set)
161
+
162
+ # source://loofah//lib/loofah/elements.rb#7
163
+ Loofah::Elements::STRICT_BLOCK_LEVEL_HTML4 = T.let(T.unsafe(nil), Set)
164
+
165
+ # https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
166
+ #
167
+ # source://loofah//lib/loofah/elements.rb#35
168
+ Loofah::Elements::STRICT_BLOCK_LEVEL_HTML5 = T.let(T.unsafe(nil), Set)
169
+
170
+ # Alias for Loofah::HTML4
171
+ #
172
+ # source://loofah//lib/loofah.rb#70
173
+ Loofah::HTML = Loofah::HTML4
174
+
175
+ # source://loofah//lib/loofah/html4/document.rb#4
176
+ module Loofah::HTML4; end
177
+
178
+ # Subclass of Nokogiri::HTML4::Document.
179
+ #
180
+ # See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods.
181
+ #
182
+ # source://loofah//lib/loofah/html4/document.rb#10
183
+ class Loofah::HTML4::Document < ::Nokogiri::HTML4::Document
184
+ include ::Loofah::ScrubBehavior::Node
185
+ include ::Loofah::DocumentDecorator
186
+ include ::Loofah::TextBehavior
187
+ include ::Loofah::HtmlDocumentBehavior
188
+ extend ::Loofah::HtmlDocumentBehavior::ClassMethods
189
+ end
190
+
191
+ # Subclass of Nokogiri::HTML4::DocumentFragment.
192
+ #
193
+ # See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods.
194
+ #
195
+ # source://loofah//lib/loofah/html4/document_fragment.rb#10
196
+ class Loofah::HTML4::DocumentFragment < ::Nokogiri::HTML4::DocumentFragment
197
+ include ::Loofah::TextBehavior
198
+ include ::Loofah::HtmlFragmentBehavior
199
+ extend ::Loofah::HtmlFragmentBehavior::ClassMethods
200
+ end
201
+
202
+ # source://loofah//lib/loofah/html5/safelist.rb#6
203
+ module Loofah::HTML5; end
204
+
205
+ # Subclass of Nokogiri::HTML5::Document.
206
+ #
207
+ # See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods.
208
+ #
209
+ # source://loofah//lib/loofah/html5/document.rb#10
210
+ class Loofah::HTML5::Document < ::Nokogiri::HTML5::Document
211
+ include ::Loofah::ScrubBehavior::Node
212
+ include ::Loofah::DocumentDecorator
213
+ include ::Loofah::TextBehavior
214
+ include ::Loofah::HtmlDocumentBehavior
215
+ extend ::Loofah::HtmlDocumentBehavior::ClassMethods
216
+ end
217
+
218
+ # Subclass of Nokogiri::HTML5::DocumentFragment.
219
+ #
220
+ # See Loofah::ScrubBehavior and Loofah::TextBehavior for additional methods.
221
+ #
222
+ # source://loofah//lib/loofah/html5/document_fragment.rb#10
223
+ class Loofah::HTML5::DocumentFragment < ::Nokogiri::HTML5::DocumentFragment
224
+ include ::Loofah::TextBehavior
225
+ include ::Loofah::HtmlFragmentBehavior
226
+ extend ::Loofah::HtmlFragmentBehavior::ClassMethods
227
+ end
228
+
229
+ # source://loofah//lib/loofah/html5/safelist.rb#49
230
+ module Loofah::HTML5::SafeList; end
231
+
232
+ # source://loofah//lib/loofah/html5/safelist.rb#232
233
+ Loofah::HTML5::SafeList::ACCEPTABLE_ATTRIBUTES = T.let(T.unsafe(nil), Set)
234
+
235
+ # https://www.w3.org/TR/css-color-3/#html4
236
+ #
237
+ # source://loofah//lib/loofah/html5/safelist.rb#735
238
+ Loofah::HTML5::SafeList::ACCEPTABLE_CSS_COLORS = T.let(T.unsafe(nil), Set)
239
+
240
+ # https://www.w3.org/TR/css-color-3/#svg-color
241
+ #
242
+ # source://loofah//lib/loofah/html5/safelist.rb#755
243
+ Loofah::HTML5::SafeList::ACCEPTABLE_CSS_EXTENDED_COLORS = T.let(T.unsafe(nil), Set)
244
+
245
+ # see https://www.quackit.com/css/functions/
246
+ # omit `url` and `image` from that list
247
+ #
248
+ # source://loofah//lib/loofah/html5/safelist.rb#907
249
+ Loofah::HTML5::SafeList::ACCEPTABLE_CSS_FUNCTIONS = T.let(T.unsafe(nil), Set)
250
+
251
+ # source://loofah//lib/loofah/html5/safelist.rb#696
252
+ Loofah::HTML5::SafeList::ACCEPTABLE_CSS_KEYWORDS = T.let(T.unsafe(nil), Set)
253
+
254
+ # source://loofah//lib/loofah/html5/safelist.rb#626
255
+ Loofah::HTML5::SafeList::ACCEPTABLE_CSS_PROPERTIES = T.let(T.unsafe(nil), Set)
256
+
257
+ # source://loofah//lib/loofah/html5/safelist.rb#50
258
+ Loofah::HTML5::SafeList::ACCEPTABLE_ELEMENTS = T.let(T.unsafe(nil), Set)
259
+
260
+ # source://loofah//lib/loofah/html5/safelist.rb#980
261
+ Loofah::HTML5::SafeList::ACCEPTABLE_PROTOCOLS = T.let(T.unsafe(nil), Set)
262
+
263
+ # source://loofah//lib/loofah/html5/safelist.rb#967
264
+ Loofah::HTML5::SafeList::ACCEPTABLE_SVG_PROPERTIES = T.let(T.unsafe(nil), Set)
265
+
266
+ # source://loofah//lib/loofah/html5/safelist.rb#1011
267
+ Loofah::HTML5::SafeList::ACCEPTABLE_URI_DATA_MEDIATYPES = T.let(T.unsafe(nil), Set)
268
+
269
+ # source://loofah//lib/loofah/html5/safelist.rb#1021
270
+ Loofah::HTML5::SafeList::ALLOWED_ATTRIBUTES = T.let(T.unsafe(nil), Set)
271
+
272
+ # source://loofah//lib/loofah/html5/safelist.rb#1024
273
+ Loofah::HTML5::SafeList::ALLOWED_CSS_FUNCTIONS = T.let(T.unsafe(nil), Set)
274
+
275
+ # source://loofah//lib/loofah/html5/safelist.rb#1023
276
+ Loofah::HTML5::SafeList::ALLOWED_CSS_KEYWORDS = T.let(T.unsafe(nil), Set)
277
+
278
+ # source://loofah//lib/loofah/html5/safelist.rb#1022
279
+ Loofah::HTML5::SafeList::ALLOWED_CSS_PROPERTIES = T.let(T.unsafe(nil), Set)
280
+
281
+ # subclasses may define their own versions of these constants
282
+ #
283
+ # source://loofah//lib/loofah/html5/safelist.rb#1020
284
+ Loofah::HTML5::SafeList::ALLOWED_ELEMENTS = T.let(T.unsafe(nil), Set)
285
+
286
+ # source://loofah//lib/loofah/html5/safelist.rb#1045
287
+ Loofah::HTML5::SafeList::ALLOWED_ELEMENTS_WITH_LIBXML2 = T.let(T.unsafe(nil), Set)
288
+
289
+ # source://loofah//lib/loofah/html5/safelist.rb#1026
290
+ Loofah::HTML5::SafeList::ALLOWED_PROTOCOLS = T.let(T.unsafe(nil), Set)
291
+
292
+ # source://loofah//lib/loofah/html5/safelist.rb#1025
293
+ Loofah::HTML5::SafeList::ALLOWED_SVG_PROPERTIES = T.let(T.unsafe(nil), Set)
294
+
295
+ # source://loofah//lib/loofah/html5/safelist.rb#1027
296
+ Loofah::HTML5::SafeList::ALLOWED_URI_DATA_MEDIATYPES = T.let(T.unsafe(nil), Set)
297
+
298
+ # source://loofah//lib/loofah/html5/safelist.rb#526
299
+ Loofah::HTML5::SafeList::ARIA_ATTRIBUTES = T.let(T.unsafe(nil), Set)
300
+
301
+ # source://loofah//lib/loofah/html5/safelist.rb#582
302
+ Loofah::HTML5::SafeList::ATTR_VAL_IS_URI = T.let(T.unsafe(nil), Set)
303
+
304
+ # source://loofah//lib/loofah/html5/safelist.rb#315
305
+ Loofah::HTML5::SafeList::MATHML_ATTRIBUTES = T.let(T.unsafe(nil), Set)
306
+
307
+ # source://loofah//lib/loofah/html5/safelist.rb#147
308
+ Loofah::HTML5::SafeList::MATHML_ELEMENTS = T.let(T.unsafe(nil), Set)
309
+
310
+ # source://loofah//lib/loofah/html5/safelist.rb#978
311
+ Loofah::HTML5::SafeList::PROTOCOL_SEPARATOR = T.let(T.unsafe(nil), Regexp)
312
+
313
+ # source://loofah//lib/loofah/html5/safelist.rb#960
314
+ Loofah::HTML5::SafeList::SHORTHAND_CSS_PROPERTIES = T.let(T.unsafe(nil), Set)
315
+
316
+ # source://loofah//lib/loofah/html5/safelist.rb#608
317
+ Loofah::HTML5::SafeList::SVG_ALLOW_LOCAL_HREF = T.let(T.unsafe(nil), Set)
318
+
319
+ # source://loofah//lib/loofah/html5/safelist.rb#367
320
+ Loofah::HTML5::SafeList::SVG_ATTRIBUTES = T.let(T.unsafe(nil), Set)
321
+
322
+ # source://loofah//lib/loofah/html5/safelist.rb#594
323
+ Loofah::HTML5::SafeList::SVG_ATTR_VAL_ALLOWS_REF = T.let(T.unsafe(nil), Set)
324
+
325
+ # source://loofah//lib/loofah/html5/safelist.rb#183
326
+ Loofah::HTML5::SafeList::SVG_ELEMENTS = T.let(T.unsafe(nil), Set)
327
+
328
+ # additional tags we should consider safe since we have libxml2 fixing up our documents.
329
+ #
330
+ # source://loofah//lib/loofah/html5/safelist.rb#1040
331
+ Loofah::HTML5::SafeList::TAGS_SAFE_WITH_LIBXML2 = T.let(T.unsafe(nil), Set)
332
+
333
+ # TODO: remove VOID_ELEMENTS in a future major release
334
+ # and put it in the tests (it is used only for testing, not for functional behavior)
335
+ #
336
+ # source://loofah//lib/loofah/html5/safelist.rb#1031
337
+ Loofah::HTML5::SafeList::VOID_ELEMENTS = T.let(T.unsafe(nil), Set)
338
+
339
+ # source://loofah//lib/loofah/html5/scrub.rb#8
340
+ module Loofah::HTML5::Scrub
341
+ class << self
342
+ # @return [Boolean]
343
+ #
344
+ # source://loofah//lib/loofah/html5/scrub.rb#18
345
+ def allowed_element?(element_name); end
346
+
347
+ # source://loofah//lib/loofah/html5/scrub.rb#192
348
+ def cdata_escape(node); end
349
+
350
+ # @return [Boolean]
351
+ #
352
+ # source://loofah//lib/loofah/html5/scrub.rb#187
353
+ def cdata_needs_escaping?(node); end
354
+
355
+ # source://loofah//lib/loofah/html5/scrub.rb#207
356
+ def escape_tags(string); end
357
+
358
+ # libxml2 >= 2.9.2 fails to escape comments within some attributes.
359
+ #
360
+ # see comments about CVE-2018-8048 within the tests for more information
361
+ #
362
+ # source://loofah//lib/loofah/html5/scrub.rb#166
363
+ def force_correct_attribute_escaping!(node); end
364
+
365
+ # source://loofah//lib/loofah/html5/scrub.rb#123
366
+ def scrub_attribute_that_allows_local_ref(attr_node); end
367
+
368
+ # alternative implementation of the html5lib attribute scrubbing algorithm
369
+ #
370
+ # source://loofah//lib/loofah/html5/scrub.rb#23
371
+ def scrub_attributes(node); end
372
+
373
+ # source://loofah//lib/loofah/html5/scrub.rb#72
374
+ def scrub_css(style); end
375
+
376
+ # source://loofah//lib/loofah/html5/scrub.rb#67
377
+ def scrub_css_attribute(node); end
378
+
379
+ # source://loofah//lib/loofah/html5/scrub.rb#142
380
+ def scrub_uri_attribute(attr_node); end
381
+ end
382
+ end
383
+
384
+ # source://loofah//lib/loofah/html5/scrub.rb#9
385
+ Loofah::HTML5::Scrub::CONTROL_CHARACTERS = T.let(T.unsafe(nil), Regexp)
386
+
387
+ # source://loofah//lib/loofah/html5/scrub.rb#11
388
+ Loofah::HTML5::Scrub::CRASS_SEMICOLON = T.let(T.unsafe(nil), Hash)
389
+
390
+ # source://loofah//lib/loofah/html5/scrub.rb#12
391
+ Loofah::HTML5::Scrub::CSS_IMPORTANT = T.let(T.unsafe(nil), String)
392
+
393
+ # source://loofah//lib/loofah/html5/scrub.rb#10
394
+ Loofah::HTML5::Scrub::CSS_KEYWORDISH = T.let(T.unsafe(nil), Regexp)
395
+
396
+ # source://loofah//lib/loofah/html5/scrub.rb#14
397
+ Loofah::HTML5::Scrub::CSS_PROPERTY_STRING_WITHOUT_EMBEDDED_QUOTES = T.let(T.unsafe(nil), Regexp)
398
+
399
+ # source://loofah//lib/loofah/html5/scrub.rb#13
400
+ Loofah::HTML5::Scrub::CSS_WHITESPACE = T.let(T.unsafe(nil), String)
401
+
402
+ # source://loofah//lib/loofah/html5/scrub.rb#15
403
+ Loofah::HTML5::Scrub::DATA_ATTRIBUTE_NAME = T.let(T.unsafe(nil), Regexp)
404
+
405
+ # source://loofah//lib/loofah/html5/safelist.rb#1048
406
+ Loofah::HTML5::WhiteList = Loofah::HTML5::SafeList
407
+
408
+ # source://loofah//lib/loofah/concerns.rb#133
409
+ module Loofah::HtmlDocumentBehavior
410
+ mixes_in_class_methods ::Loofah::HtmlDocumentBehavior::ClassMethods
411
+
412
+ # source://loofah//lib/loofah/concerns.rb#164
413
+ def serialize_root; end
414
+
415
+ class << self
416
+ # @private
417
+ #
418
+ # source://loofah//lib/loofah/concerns.rb#159
419
+ def included(base); end
420
+ end
421
+ end
422
+
423
+ # source://loofah//lib/loofah/concerns.rb#134
424
+ module Loofah::HtmlDocumentBehavior::ClassMethods
425
+ # source://loofah//lib/loofah/concerns.rb#135
426
+ def parse(*args, &block); end
427
+
428
+ private
429
+
430
+ # remove comments that exist outside of the HTML element.
431
+ #
432
+ # these comments are allowed by the HTML spec:
433
+ #
434
+ # https://www.w3.org/TR/html401/struct/global.html#h-7.1
435
+ #
436
+ # but are not scrubbed by Loofah because these nodes don't meet
437
+ # the contract that scrubbers expect of a node (e.g., it can be
438
+ # replaced, sibling and children nodes can be created).
439
+ #
440
+ # source://loofah//lib/loofah/concerns.rb#150
441
+ def remove_comments_before_html_element(doc); end
442
+ end
443
+
444
+ # source://loofah//lib/loofah/concerns.rb#169
445
+ module Loofah::HtmlFragmentBehavior
446
+ mixes_in_class_methods ::Loofah::HtmlFragmentBehavior::ClassMethods
447
+
448
+ # source://loofah//lib/loofah/concerns.rb#197
449
+ def serialize; end
450
+
451
+ # source://loofah//lib/loofah/concerns.rb#203
452
+ def serialize_root; end
453
+
454
+ # source://loofah//lib/loofah/concerns.rb#197
455
+ def to_s; end
456
+
457
+ class << self
458
+ # @private
459
+ #
460
+ # source://loofah//lib/loofah/concerns.rb#192
461
+ def included(base); end
462
+ end
463
+ end
464
+
465
+ # source://loofah//lib/loofah/concerns.rb#170
466
+ module Loofah::HtmlFragmentBehavior::ClassMethods
467
+ # source://loofah//lib/loofah/concerns.rb#180
468
+ def document_klass; end
469
+
470
+ # source://loofah//lib/loofah/concerns.rb#171
471
+ def parse(tags, encoding = T.unsafe(nil)); end
472
+ end
473
+
474
+ # constants related to working around unhelpful libxml2 behavior
475
+ #
476
+ # ಠ_ಠ
477
+ #
478
+ # source://loofah//lib/loofah/html5/libxml2_workarounds.rb#12
479
+ module Loofah::LibxmlWorkarounds; end
480
+
481
+ # these attributes and qualifying parent tags are determined by the code at:
482
+ #
483
+ # https://git.gnome.org/browse/libxml2/tree/HTMLtree.c?h=v2.9.2#n714
484
+ #
485
+ # see comments about CVE-2018-8048 within the tests for more information
486
+ #
487
+ # source://loofah//lib/loofah/html5/libxml2_workarounds.rb#20
488
+ Loofah::LibxmlWorkarounds::BROKEN_ESCAPING_ATTRIBUTES = T.let(T.unsafe(nil), Set)
489
+
490
+ # source://loofah//lib/loofah/html5/libxml2_workarounds.rb#26
491
+ Loofah::LibxmlWorkarounds::BROKEN_ESCAPING_ATTRIBUTES_QUALIFYING_TAG = T.let(T.unsafe(nil), Hash)
492
+
493
+ # source://loofah//lib/loofah/metahelpers.rb#4
494
+ module Loofah::MetaHelpers
495
+ class << self
496
+ # source://loofah//lib/loofah/metahelpers.rb#6
497
+ def add_downcased_set_members_to_all_set_constants(mojule); end
498
+ end
499
+ end
500
+
501
+ # Mixes +scrub!+ into Document, DocumentFragment, Node and NodeSet.
502
+ #
503
+ # Traverse the document or fragment, invoking the +scrubber+ on each node.
504
+ #
505
+ # +scrubber+ must either be one of the symbols representing the built-in scrubbers (see
506
+ # Scrubbers), or a Scrubber instance.
507
+ #
508
+ # span2div = Loofah::Scrubber.new do |node|
509
+ # node.name = "div" if node.name == "span"
510
+ # end
511
+ # Loofah.html5_fragment("<span>foo</span><p>bar</p>").scrub!(span2div).to_s
512
+ # # => "<div>foo</div><p>bar</p>"
513
+ #
514
+ # or
515
+ #
516
+ # unsafe_html = "ohai! <div>div is safe</div> <script>but script is not</script>"
517
+ # Loofah.html5_fragment(unsafe_html).scrub!(:strip).to_s
518
+ # # => "ohai! <div>div is safe</div> "
519
+ #
520
+ # Note that this method is called implicitly from the shortcuts Loofah.scrub_html5_fragment et
521
+ # al.
522
+ #
523
+ # Please see Scrubber for more information on implementation and traversal, and README.rdoc for
524
+ # more example usage.
525
+ #
526
+ # source://loofah//lib/loofah/concerns.rb#30
527
+ module Loofah::ScrubBehavior
528
+ class << self
529
+ # source://loofah//lib/loofah/concerns.rb#59
530
+ def resolve_scrubber(scrubber); end
531
+ end
532
+ end
533
+
534
+ # source://loofah//lib/loofah/concerns.rb#31
535
+ module Loofah::ScrubBehavior::Node
536
+ # source://loofah//lib/loofah/concerns.rb#32
537
+ def scrub!(scrubber); end
538
+ end
539
+
540
+ # source://loofah//lib/loofah/concerns.rb#51
541
+ module Loofah::ScrubBehavior::NodeSet
542
+ # source://loofah//lib/loofah/concerns.rb#52
543
+ def scrub!(scrubber); end
544
+ end
545
+
546
+ # A Scrubber wraps up a block (or method) that is run on an HTML node (element):
547
+ #
548
+ # # change all <span> tags to <div> tags
549
+ # span2div = Loofah::Scrubber.new do |node|
550
+ # node.name = "div" if node.name == "span"
551
+ # end
552
+ #
553
+ # Alternatively, this scrubber could have been implemented as:
554
+ #
555
+ # class Span2Div < Loofah::Scrubber
556
+ # def scrub(node)
557
+ # node.name = "div" if node.name == "span"
558
+ # end
559
+ # end
560
+ # span2div = Span2Div.new
561
+ #
562
+ # This can then be run on a document:
563
+ #
564
+ # Loofah.html5_fragment("<span>foo</span><p>bar</p>").scrub!(span2div).to_s
565
+ # # => "<div>foo</div><p>bar</p>"
566
+ #
567
+ # Scrubbers can be run on a document in either a top-down traversal (the
568
+ # default) or bottom-up. Top-down scrubbers can optionally return
569
+ # Scrubber::STOP to terminate the traversal of a subtree.
570
+ #
571
+ # source://loofah//lib/loofah/scrubber.rb#35
572
+ class Loofah::Scrubber
573
+ # Options may include
574
+ # :direction => :top_down (the default)
575
+ # or
576
+ # :direction => :bottom_up
577
+ #
578
+ # For top_down traversals, if the block returns
579
+ # Loofah::Scrubber::STOP, then the traversal will be terminated
580
+ # for the current node's subtree.
581
+ #
582
+ # Alternatively, a Scrubber may inherit from Loofah::Scrubber,
583
+ # and implement +scrub+, which is slightly faster than using a
584
+ # block.
585
+ #
586
+ # @return [Scrubber] a new instance of Scrubber
587
+ #
588
+ # source://loofah//lib/loofah/scrubber.rb#65
589
+ def initialize(options = T.unsafe(nil), &block); end
590
+
591
+ # If the attribute is not set, add it
592
+ # If the attribute is set, don't overwrite the existing value
593
+ #
594
+ # source://loofah//lib/loofah/scrubber.rb#96
595
+ def append_attribute(node, attribute, value); end
596
+
597
+ # When a scrubber is initialized, the optional block is saved as
598
+ # :block. Note that, if no block is passed, then the +scrub+
599
+ # method is assumed to have been implemented.
600
+ #
601
+ # source://loofah//lib/loofah/scrubber.rb#49
602
+ def block; end
603
+
604
+ # When a scrubber is initialized, the :direction may be specified
605
+ # as :top_down (the default) or :bottom_up.
606
+ #
607
+ # source://loofah//lib/loofah/scrubber.rb#44
608
+ def direction; end
609
+
610
+ # When +new+ is not passed a block, the class may implement
611
+ # +scrub+, which will be called for each document node.
612
+ #
613
+ # @raise [ScrubberNotFound]
614
+ #
615
+ # source://loofah//lib/loofah/scrubber.rb#88
616
+ def scrub(node); end
617
+
618
+ # Calling +traverse+ will cause the document to be traversed by
619
+ # either the lambda passed to the initializer or the +scrub+
620
+ # method, in the direction specified at +new+ time.
621
+ #
622
+ # source://loofah//lib/loofah/scrubber.rb#80
623
+ def traverse(node); end
624
+
625
+ private
626
+
627
+ # source://loofah//lib/loofah/scrubber.rb#105
628
+ def html5lib_sanitize(node); end
629
+
630
+ # source://loofah//lib/loofah/scrubber.rb#131
631
+ def traverse_conditionally_bottom_up(node); end
632
+
633
+ # source://loofah//lib/loofah/scrubber.rb#122
634
+ def traverse_conditionally_top_down(node); end
635
+ end
636
+
637
+ # Top-down Scrubbers may return CONTINUE to indicate that the subtree should be traversed.
638
+ #
639
+ # source://loofah//lib/loofah/scrubber.rb#37
640
+ Loofah::Scrubber::CONTINUE = T.let(T.unsafe(nil), Object)
641
+
642
+ # Top-down Scrubbers may return STOP to indicate that the subtree should not be traversed.
643
+ #
644
+ # source://loofah//lib/loofah/scrubber.rb#40
645
+ Loofah::Scrubber::STOP = T.let(T.unsafe(nil), Object)
646
+
647
+ # A RuntimeError raised when Loofah could not find an appropriate scrubber.
648
+ #
649
+ # source://loofah//lib/loofah/scrubber.rb#7
650
+ class Loofah::ScrubberNotFound < ::RuntimeError; end
651
+
652
+ # Loofah provides some built-in scrubbers for sanitizing with
653
+ # HTML5lib's safelist and for accomplishing some common
654
+ # transformation tasks.
655
+ #
656
+ #
657
+ # === Loofah::Scrubbers::Strip / scrub!(:strip)
658
+ #
659
+ # +:strip+ removes unknown/unsafe tags, but leaves behind the pristine contents:
660
+ #
661
+ # unsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
662
+ # Loofah.html5_fragment(unsafe_html).scrub!(:strip)
663
+ # => "ohai! <div>div is safe</div> but foo is <b>not</b>"
664
+ #
665
+ #
666
+ # === Loofah::Scrubbers::Prune / scrub!(:prune)
667
+ #
668
+ # +:prune+ removes unknown/unsafe tags and their contents (including their subtrees):
669
+ #
670
+ # unsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
671
+ # Loofah.html5_fragment(unsafe_html).scrub!(:prune)
672
+ # => "ohai! <div>div is safe</div> "
673
+ #
674
+ #
675
+ # === Loofah::Scrubbers::Escape / scrub!(:escape)
676
+ #
677
+ # +:escape+ performs HTML entity escaping on the unknown/unsafe tags:
678
+ #
679
+ # unsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
680
+ # Loofah.html5_fragment(unsafe_html).scrub!(:escape)
681
+ # => "ohai! <div>div is safe</div> &lt;foo&gt;but foo is &lt;b&gt;not&lt;/b&gt;&lt;/foo&gt;"
682
+ #
683
+ #
684
+ # === Loofah::Scrubbers::Whitewash / scrub!(:whitewash)
685
+ #
686
+ # +:whitewash+ removes all comments, styling and attributes in
687
+ # addition to doing markup-fixer-uppery and pruning unsafe tags. I
688
+ # like to call this "whitewashing", since it's like putting a new
689
+ # layer of paint on top of the HTML input to make it look nice.
690
+ #
691
+ # messy_markup = "ohai! <div id='foo' class='bar' style='margin: 10px'>div with attributes</div>"
692
+ # Loofah.html5_fragment(messy_markup).scrub!(:whitewash)
693
+ # => "ohai! <div>div with attributes</div>"
694
+ #
695
+ # One use case for this scrubber is to clean up HTML that was
696
+ # cut-and-pasted from Microsoft Word into a WYSIWYG editor or a
697
+ # rich text editor. Microsoft's software is famous for injecting
698
+ # all kinds of cruft into its HTML output. Who needs that crap?
699
+ # Certainly not me.
700
+ #
701
+ #
702
+ # === Loofah::Scrubbers::NoFollow / scrub!(:nofollow)
703
+ #
704
+ # +:nofollow+ adds a rel="nofollow" attribute to all links
705
+ #
706
+ # link_farmers_markup = "ohai! <a href='http://www.myswarmysite.com/'>I like your blog post</a>"
707
+ # Loofah.html5_fragment(link_farmers_markup).scrub!(:nofollow)
708
+ # => "ohai! <a href='http://www.myswarmysite.com/' rel="nofollow">I like your blog post</a>"
709
+ #
710
+ #
711
+ # === Loofah::Scrubbers::NoOpener / scrub!(:noopener)
712
+ #
713
+ # +:noopener+ adds a rel="noopener" attribute to all links
714
+ #
715
+ # link_farmers_markup = "ohai! <a href='http://www.myswarmysite.com/'>I like your blog post</a>"
716
+ # Loofah.html5_fragment(link_farmers_markup).scrub!(:noopener)
717
+ # => "ohai! <a href='http://www.myswarmysite.com/' rel="noopener">I like your blog post</a>"
718
+ #
719
+ #
720
+ # === Loofah::Scrubbers::Unprintable / scrub!(:unprintable)
721
+ #
722
+ # +:unprintable+ removes unprintable Unicode characters.
723
+ #
724
+ # markup = "<p>Some text with an unprintable character at the end\u2028</p>"
725
+ # Loofah.html5_fragment(markup).scrub!(:unprintable)
726
+ # => "<p>Some text with an unprintable character at the end</p>"
727
+ #
728
+ # You may not be able to see the unprintable character in the above example, but there is a
729
+ # U+2028 character right before the closing </p> tag. These characters can cause issues if
730
+ # the content is ever parsed by JavaScript - more information here:
731
+ #
732
+ # http://timelessrepo.com/json-isnt-a-javascript-subset
733
+ #
734
+ # source://loofah//lib/loofah/scrubbers.rb#87
735
+ module Loofah::Scrubbers
736
+ class << self
737
+ # Returns an array of symbols representing the built-in scrubbers
738
+ #
739
+ # source://loofah//lib/loofah/scrubbers.rb#303
740
+ def scrubber_symbols; end
741
+ end
742
+ end
743
+
744
+ # === scrub!(:escape)
745
+ #
746
+ # +:escape+ performs HTML entity escaping on the unknown/unsafe tags:
747
+ #
748
+ # unsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
749
+ # Loofah.html5_fragment(unsafe_html).scrub!(:escape)
750
+ # => "ohai! <div>div is safe</div> &lt;foo&gt;but foo is &lt;b&gt;not&lt;/b&gt;&lt;/foo&gt;"
751
+ #
752
+ # source://loofah//lib/loofah/scrubbers.rb#142
753
+ class Loofah::Scrubbers::Escape < ::Loofah::Scrubber
754
+ # @return [Escape] a new instance of Escape
755
+ #
756
+ # source://loofah//lib/loofah/scrubbers.rb#143
757
+ def initialize; end
758
+
759
+ # source://loofah//lib/loofah/scrubbers.rb#147
760
+ def scrub(node); end
761
+ end
762
+
763
+ # A hash that maps a symbol (like +:prune+) to the appropriate Scrubber (Loofah::Scrubbers::Prune).
764
+ #
765
+ # source://loofah//lib/loofah/scrubbers.rb#288
766
+ Loofah::Scrubbers::MAP = T.let(T.unsafe(nil), Hash)
767
+
768
+ # This class probably isn't useful publicly, but is used for #to_text's current implemention
769
+ #
770
+ # source://loofah//lib/loofah/scrubbers.rb#239
771
+ class Loofah::Scrubbers::NewlineBlockElements < ::Loofah::Scrubber
772
+ # @return [NewlineBlockElements] a new instance of NewlineBlockElements
773
+ #
774
+ # source://loofah//lib/loofah/scrubbers.rb#240
775
+ def initialize; end
776
+
777
+ # source://loofah//lib/loofah/scrubbers.rb#244
778
+ def scrub(node); end
779
+ end
780
+
781
+ # === scrub!(:nofollow)
782
+ #
783
+ # +:nofollow+ adds a rel="nofollow" attribute to all links
784
+ #
785
+ # link_farmers_markup = "ohai! <a href='http://www.myswarmysite.com/'>I like your blog post</a>"
786
+ # Loofah.html5_fragment(link_farmers_markup).scrub!(:nofollow)
787
+ # => "ohai! <a href='http://www.myswarmysite.com/' rel="nofollow">I like your blog post</a>"
788
+ #
789
+ # source://loofah//lib/loofah/scrubbers.rb#203
790
+ class Loofah::Scrubbers::NoFollow < ::Loofah::Scrubber
791
+ # @return [NoFollow] a new instance of NoFollow
792
+ #
793
+ # source://loofah//lib/loofah/scrubbers.rb#204
794
+ def initialize; end
795
+
796
+ # source://loofah//lib/loofah/scrubbers.rb#208
797
+ def scrub(node); end
798
+ end
799
+
800
+ # === scrub!(:noopener)
801
+ #
802
+ # +:noopener+ adds a rel="noopener" attribute to all links
803
+ #
804
+ # link_farmers_markup = "ohai! <a href='http://www.myswarmysite.com/'>I like your blog post</a>"
805
+ # Loofah.html5_fragment(link_farmers_markup).scrub!(:noopener)
806
+ # => "ohai! <a href='http://www.myswarmysite.com/' rel="noopener">I like your blog post</a>"
807
+ #
808
+ # source://loofah//lib/loofah/scrubbers.rb#225
809
+ class Loofah::Scrubbers::NoOpener < ::Loofah::Scrubber
810
+ # @return [NoOpener] a new instance of NoOpener
811
+ #
812
+ # source://loofah//lib/loofah/scrubbers.rb#226
813
+ def initialize; end
814
+
815
+ # source://loofah//lib/loofah/scrubbers.rb#230
816
+ def scrub(node); end
817
+ end
818
+
819
+ # === scrub!(:prune)
820
+ #
821
+ # +:prune+ removes unknown/unsafe tags and their contents (including their subtrees):
822
+ #
823
+ # unsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
824
+ # Loofah.html5_fragment(unsafe_html).scrub!(:prune)
825
+ # => "ohai! <div>div is safe</div> "
826
+ #
827
+ # source://loofah//lib/loofah/scrubbers.rb#120
828
+ class Loofah::Scrubbers::Prune < ::Loofah::Scrubber
829
+ # @return [Prune] a new instance of Prune
830
+ #
831
+ # source://loofah//lib/loofah/scrubbers.rb#121
832
+ def initialize; end
833
+
834
+ # source://loofah//lib/loofah/scrubbers.rb#125
835
+ def scrub(node); end
836
+ end
837
+
838
+ # === scrub!(:strip)
839
+ #
840
+ # +:strip+ removes unknown/unsafe tags, but leaves behind the pristine contents:
841
+ #
842
+ # unsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>"
843
+ # Loofah.html5_fragment(unsafe_html).scrub!(:strip)
844
+ # => "ohai! <div>div is safe</div> but foo is <b>not</b>"
845
+ #
846
+ # source://loofah//lib/loofah/scrubbers.rb#97
847
+ class Loofah::Scrubbers::Strip < ::Loofah::Scrubber
848
+ # @return [Strip] a new instance of Strip
849
+ #
850
+ # source://loofah//lib/loofah/scrubbers.rb#98
851
+ def initialize; end
852
+
853
+ # source://loofah//lib/loofah/scrubbers.rb#102
854
+ def scrub(node); end
855
+ end
856
+
857
+ # === scrub!(:unprintable)
858
+ #
859
+ # +:unprintable+ removes unprintable Unicode characters.
860
+ #
861
+ # markup = "<p>Some text with an unprintable character at the end\u2028</p>"
862
+ # Loofah.html5_fragment(markup).scrub!(:unprintable)
863
+ # => "<p>Some text with an unprintable character at the end</p>"
864
+ #
865
+ # You may not be able to see the unprintable character in the above example, but there is a
866
+ # U+2028 character right before the closing </p> tag. These characters can cause issues if
867
+ # the content is ever parsed by JavaScript - more information here:
868
+ #
869
+ # http://timelessrepo.com/json-isnt-a-javascript-subset
870
+ #
871
+ # source://loofah//lib/loofah/scrubbers.rb#272
872
+ class Loofah::Scrubbers::Unprintable < ::Loofah::Scrubber
873
+ # @return [Unprintable] a new instance of Unprintable
874
+ #
875
+ # source://loofah//lib/loofah/scrubbers.rb#273
876
+ def initialize; end
877
+
878
+ # source://loofah//lib/loofah/scrubbers.rb#277
879
+ def scrub(node); end
880
+ end
881
+
882
+ # === scrub!(:whitewash)
883
+ #
884
+ # +:whitewash+ removes all comments, styling and attributes in
885
+ # addition to doing markup-fixer-uppery and pruning unsafe tags. I
886
+ # like to call this "whitewashing", since it's like putting a new
887
+ # layer of paint on top of the HTML input to make it look nice.
888
+ #
889
+ # messy_markup = "ohai! <div id='foo' class='bar' style='margin: 10px'>div with attributes</div>"
890
+ # Loofah.html5_fragment(messy_markup).scrub!(:whitewash)
891
+ # => "ohai! <div>div with attributes</div>"
892
+ #
893
+ # One use case for this scrubber is to clean up HTML that was
894
+ # cut-and-pasted from Microsoft Word into a WYSIWYG editor or a
895
+ # rich text editor. Microsoft's software is famous for injecting
896
+ # all kinds of cruft into its HTML output. Who needs that crap?
897
+ # Certainly not me.
898
+ #
899
+ # source://loofah//lib/loofah/scrubbers.rb#174
900
+ class Loofah::Scrubbers::Whitewash < ::Loofah::Scrubber
901
+ # @return [Whitewash] a new instance of Whitewash
902
+ #
903
+ # source://loofah//lib/loofah/scrubbers.rb#175
904
+ def initialize; end
905
+
906
+ # source://loofah//lib/loofah/scrubbers.rb#179
907
+ def scrub(node); end
908
+ end
909
+
910
+ # Overrides +text+ in Document and DocumentFragment classes, and mixes in +to_text+.
911
+ #
912
+ # source://loofah//lib/loofah/concerns.rb#73
913
+ module Loofah::TextBehavior
914
+ # Returns a plain-text version of the markup contained by the document, with HTML entities
915
+ # encoded.
916
+ #
917
+ # This method is significantly faster than #to_text, but isn't clever about whitespace around
918
+ # block elements.
919
+ #
920
+ # Loofah.html5_document("<h1>Title</h1><div>Content</div>").text
921
+ # # => "TitleContent"
922
+ #
923
+ # By default, the returned text will have HTML entities escaped. If you want unescaped
924
+ # entities, and you understand that the result is unsafe to render in a browser, then you can
925
+ # pass an argument as shown:
926
+ #
927
+ # frag = Loofah.html5_fragment("&lt;script&gt;alert('EVIL');&lt;/script&gt;")
928
+ # # ok for browser:
929
+ # frag.text # => "&lt;script&gt;alert('EVIL');&lt;/script&gt;"
930
+ # # decidedly not ok for browser:
931
+ # frag.text(:encode_special_chars => false) # => "<script>alert('EVIL');</script>"
932
+ #
933
+ # source://loofah//lib/loofah/concerns.rb#94
934
+ def inner_text(options = T.unsafe(nil)); end
935
+
936
+ # Returns a plain-text version of the markup contained by the document, with HTML entities
937
+ # encoded.
938
+ #
939
+ # This method is significantly faster than #to_text, but isn't clever about whitespace around
940
+ # block elements.
941
+ #
942
+ # Loofah.html5_document("<h1>Title</h1><div>Content</div>").text
943
+ # # => "TitleContent"
944
+ #
945
+ # By default, the returned text will have HTML entities escaped. If you want unescaped
946
+ # entities, and you understand that the result is unsafe to render in a browser, then you can
947
+ # pass an argument as shown:
948
+ #
949
+ # frag = Loofah.html5_fragment("&lt;script&gt;alert('EVIL');&lt;/script&gt;")
950
+ # # ok for browser:
951
+ # frag.text # => "&lt;script&gt;alert('EVIL');&lt;/script&gt;"
952
+ # # decidedly not ok for browser:
953
+ # frag.text(:encode_special_chars => false) # => "<script>alert('EVIL');</script>"
954
+ #
955
+ # source://loofah//lib/loofah/concerns.rb#94
956
+ def text(options = T.unsafe(nil)); end
957
+
958
+ # Returns a plain-text version of the markup contained by the document, with HTML entities
959
+ # encoded.
960
+ #
961
+ # This method is significantly faster than #to_text, but isn't clever about whitespace around
962
+ # block elements.
963
+ #
964
+ # Loofah.html5_document("<h1>Title</h1><div>Content</div>").text
965
+ # # => "TitleContent"
966
+ #
967
+ # By default, the returned text will have HTML entities escaped. If you want unescaped
968
+ # entities, and you understand that the result is unsafe to render in a browser, then you can
969
+ # pass an argument as shown:
970
+ #
971
+ # frag = Loofah.html5_fragment("&lt;script&gt;alert('EVIL');&lt;/script&gt;")
972
+ # # ok for browser:
973
+ # frag.text # => "&lt;script&gt;alert('EVIL');&lt;/script&gt;"
974
+ # # decidedly not ok for browser:
975
+ # frag.text(:encode_special_chars => false) # => "<script>alert('EVIL');</script>"
976
+ #
977
+ # source://loofah//lib/loofah/concerns.rb#94
978
+ def to_str(options = T.unsafe(nil)); end
979
+
980
+ # Returns a plain-text version of the markup contained by the fragment, with HTML entities
981
+ # encoded.
982
+ #
983
+ # This method is slower than #text, but is clever about whitespace around block elements and
984
+ # line break elements.
985
+ #
986
+ # Loofah.html5_document("<h1>Title</h1><div>Content<br>Next line</div>").to_text
987
+ # # => "\nTitle\n\nContent\nNext line\n"
988
+ #
989
+ # source://loofah//lib/loofah/concerns.rb#120
990
+ def to_text(options = T.unsafe(nil)); end
991
+ end
992
+
993
+ # The version of Loofah you are using
994
+ #
995
+ # source://loofah//lib/loofah/version.rb#5
996
+ Loofah::VERSION = T.let(T.unsafe(nil), String)
997
+
998
+ # source://loofah//lib/loofah/xml/document.rb#4
999
+ module Loofah::XML; end
1000
+
1001
+ # Subclass of Nokogiri::XML::Document.
1002
+ #
1003
+ # See Loofah::ScrubBehavior and Loofah::DocumentDecorator for additional methods.
1004
+ #
1005
+ # source://loofah//lib/loofah/xml/document.rb#10
1006
+ class Loofah::XML::Document < ::Nokogiri::XML::Document
1007
+ include ::Loofah::ScrubBehavior::Node
1008
+ include ::Loofah::DocumentDecorator
1009
+ end
1010
+
1011
+ # Subclass of Nokogiri::XML::DocumentFragment.
1012
+ #
1013
+ # See Loofah::ScrubBehavior for additional methods.
1014
+ #
1015
+ # source://loofah//lib/loofah/xml/document_fragment.rb#10
1016
+ class Loofah::XML::DocumentFragment < ::Nokogiri::XML::DocumentFragment
1017
+ class << self
1018
+ # source://loofah//lib/loofah/xml/document_fragment.rb#12
1019
+ def parse(tags); end
1020
+ end
1021
+ end