wal 0.0.1 → 0.0.3

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