konstruo 1.0.0
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.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +22 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +35 -0
- data/Rakefile +10 -0
- data/lib/konstruo/mapper.rb +120 -0
- data/lib/konstruo/version.rb +6 -0
- data/lib/konstruo.rb +18 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
- data/sorbet/rbi/annotations/actionpack.rbi +430 -0
- data/sorbet/rbi/annotations/actionview.rbi +75 -0
- data/sorbet/rbi/annotations/activejob.rbi +44 -0
- data/sorbet/rbi/annotations/activemodel.rbi +89 -0
- data/sorbet/rbi/annotations/activerecord.rbi +92 -0
- data/sorbet/rbi/annotations/activesupport.rbi +454 -0
- data/sorbet/rbi/annotations/globalid.rbi +30 -0
- data/sorbet/rbi/annotations/minitest.rbi +119 -0
- data/sorbet/rbi/annotations/railties.rbi +61 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/dsl/.gitattributes +1 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +23 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/actioncable@7.2.1.rbi +3096 -0
- data/sorbet/rbi/gems/actionmailbox@7.2.1.rbi +1832 -0
- data/sorbet/rbi/gems/actionmailer@7.2.1.rbi +2664 -0
- data/sorbet/rbi/gems/actionpack@7.2.1.rbi +20536 -0
- data/sorbet/rbi/gems/actiontext@7.2.1.rbi +1697 -0
- data/sorbet/rbi/gems/actionview@7.2.1.rbi +15752 -0
- data/sorbet/rbi/gems/activejob@7.2.1.rbi +2828 -0
- data/sorbet/rbi/gems/activemodel@7.2.1.rbi +6762 -0
- data/sorbet/rbi/gems/activerecord@7.2.1.rbi +41433 -0
- data/sorbet/rbi/gems/activestorage@7.2.1.rbi +3247 -0
- data/sorbet/rbi/gems/activesupport@7.2.1.rbi +21142 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
- data/sorbet/rbi/gems/base64@0.2.0.rbi +509 -0
- data/sorbet/rbi/gems/bigdecimal@3.1.8.rbi +78 -0
- data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +11645 -0
- data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
- data/sorbet/rbi/gems/dashbrains-rubocop-config@1.0.4.rbi +9 -0
- data/sorbet/rbi/gems/date@3.3.4.rbi +75 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +1131 -0
- data/sorbet/rbi/gems/drb@2.2.1.rbi +1347 -0
- data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
- data/sorbet/rbi/gems/globalid@1.2.1.rbi +749 -0
- data/sorbet/rbi/gems/i18n@1.14.5.rbi +2359 -0
- data/sorbet/rbi/gems/io-console@0.7.2.rbi +9 -0
- data/sorbet/rbi/gems/json@2.7.2.rbi +1562 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
- data/sorbet/rbi/gems/logger@1.6.1.rbi +920 -0
- data/sorbet/rbi/gems/loofah@2.22.0.rbi +1081 -0
- data/sorbet/rbi/gems/mail@2.8.1.rbi +8658 -0
- data/sorbet/rbi/gems/marcel@1.0.4.rbi +239 -0
- data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +173 -0
- data/sorbet/rbi/gems/minitest@5.25.1.rbi +1546 -0
- data/sorbet/rbi/gems/net-imap@0.4.16.rbi +10845 -0
- data/sorbet/rbi/gems/net-pop@0.1.2.rbi +927 -0
- data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
- data/sorbet/rbi/gems/net-smtp@0.5.0.rbi +1228 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
- data/sorbet/rbi/gems/nio4r@2.7.3.rbi +293 -0
- data/sorbet/rbi/gems/nokogiri@1.16.7.rbi +7311 -0
- data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
- data/sorbet/rbi/gems/parser@3.3.5.0.rbi +5519 -0
- data/sorbet/rbi/gems/prism@1.0.0.rbi +35493 -0
- data/sorbet/rbi/gems/psych@5.1.2.rbi +1769 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +162 -0
- data/sorbet/rbi/gems/rack-session@2.0.0.rbi +727 -0
- data/sorbet/rbi/gems/rack-test@2.1.0.rbi +747 -0
- data/sorbet/rbi/gems/rack@3.1.7.rbi +4902 -0
- data/sorbet/rbi/gems/rackup@2.1.0.rbi +390 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +758 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +785 -0
- data/sorbet/rbi/gems/rails@7.2.1.rbi +9 -0
- data/sorbet/rbi/gems/railties@7.2.1.rbi +3824 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
- data/sorbet/rbi/gems/rake@13.2.1.rbi +3046 -0
- data/sorbet/rbi/gems/rbi@0.2.0.rbi +4105 -0
- data/sorbet/rbi/gems/rdoc@6.7.0.rbi +12721 -0
- data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +3772 -0
- data/sorbet/rbi/gems/reline@0.5.10.rbi +9 -0
- data/sorbet/rbi/gems/rspec-core@3.13.1.rbi +11012 -0
- data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +8183 -0
- data/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi +5341 -0
- data/sorbet/rbi/gems/rspec-support@3.13.1.rbi +1630 -0
- data/sorbet/rbi/gems/rspec@3.13.0.rbi +83 -0
- data/sorbet/rbi/gems/rubocop-ast@1.32.3.rbi +7446 -0
- data/sorbet/rbi/gems/rubocop-capybara@2.21.0.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-factory_bot@2.26.1.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-graphql@1.5.4.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-minitest@0.36.0.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-performance@1.21.1.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-rails@2.26.1.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +329 -0
- data/sorbet/rbi/gems/rubocop-rspec@3.0.5.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-rspec_rails@2.30.0.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.8.5.rbi +9 -0
- data/sorbet/rbi/gems/rubocop@1.66.1.rbi +58268 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
- data/sorbet/rbi/gems/securerandom@0.3.1.rbi +396 -0
- data/sorbet/rbi/gems/spoom@1.4.2.rbi +4932 -0
- data/sorbet/rbi/gems/stringio@3.1.1.rbi +9 -0
- data/sorbet/rbi/gems/tapioca@0.16.2.rbi +3581 -0
- data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
- data/sorbet/rbi/gems/timeout@0.4.1.rbi +149 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
- data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +66 -0
- data/sorbet/rbi/gems/useragent@0.16.10.rbi +9 -0
- data/sorbet/rbi/gems/webrick@1.8.1.rbi +2607 -0
- data/sorbet/rbi/gems/websocket-driver@0.7.6.rbi +993 -0
- data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +121 -0
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
- data/sorbet/rbi/gems/yard@0.9.37.rbi +18570 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.18.rbi +1051 -0
- data/sorbet/rbi/todo.rbi +6 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +9 -0
- data/tasks/bundle_update.rake +14 -0
- data/tasks/sorbet.rake +26 -0
- metadata +216 -0
@@ -0,0 +1,785 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `rails-html-sanitizer` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem rails-html-sanitizer`.
|
6
|
+
|
7
|
+
|
8
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#14
|
9
|
+
module ActionView
|
10
|
+
class << self
|
11
|
+
# source://actionview/7.1.2/lib/action_view/deprecator.rb#4
|
12
|
+
def deprecator; end
|
13
|
+
|
14
|
+
# source://actionview/7.1.2/lib/action_view.rb#93
|
15
|
+
def eager_load!; end
|
16
|
+
|
17
|
+
# source://actionview/7.1.2/lib/action_view/gem_version.rb#5
|
18
|
+
def gem_version; end
|
19
|
+
|
20
|
+
# source://actionview/7.1.2/lib/action_view/version.rb#7
|
21
|
+
def version; end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#15
|
26
|
+
module ActionView::Helpers
|
27
|
+
include ::ActionView::Helpers::SanitizeHelper
|
28
|
+
include ::ActionView::Helpers::TextHelper
|
29
|
+
include ::ActionView::Helpers::UrlHelper
|
30
|
+
include ::ActionView::Helpers::SanitizeHelper
|
31
|
+
include ::ActionView::Helpers::TextHelper
|
32
|
+
include ::ActionView::Helpers::FormTagHelper
|
33
|
+
include ::ActionView::Helpers::FormHelper
|
34
|
+
include ::ActionView::Helpers::TranslationHelper
|
35
|
+
|
36
|
+
mixes_in_class_methods ::ActionView::Helpers::UrlHelper::ClassMethods
|
37
|
+
mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods
|
38
|
+
|
39
|
+
class << self
|
40
|
+
# source://actionview/7.1.2/lib/action_view/helpers.rb#35
|
41
|
+
def eager_load!; end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#16
|
46
|
+
module ActionView::Helpers::SanitizeHelper
|
47
|
+
mixes_in_class_methods ::ActionView::Helpers::SanitizeHelper::ClassMethods
|
48
|
+
|
49
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#100
|
50
|
+
def sanitize(html, options = T.unsafe(nil)); end
|
51
|
+
|
52
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#105
|
53
|
+
def sanitize_css(style); end
|
54
|
+
|
55
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#12
|
56
|
+
def sanitizer_vendor; end
|
57
|
+
|
58
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#12
|
59
|
+
def sanitizer_vendor=(val); end
|
60
|
+
|
61
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#139
|
62
|
+
def strip_links(html); end
|
63
|
+
|
64
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#122
|
65
|
+
def strip_tags(html); end
|
66
|
+
|
67
|
+
class << self
|
68
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#12
|
69
|
+
def sanitizer_vendor; end
|
70
|
+
|
71
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#12
|
72
|
+
def sanitizer_vendor=(val); end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#17
|
77
|
+
module ActionView::Helpers::SanitizeHelper::ClassMethods
|
78
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#164
|
79
|
+
def full_sanitizer; end
|
80
|
+
|
81
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#144
|
82
|
+
def full_sanitizer=(_arg0); end
|
83
|
+
|
84
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#174
|
85
|
+
def link_sanitizer; end
|
86
|
+
|
87
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#144
|
88
|
+
def link_sanitizer=(_arg0); end
|
89
|
+
|
90
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#184
|
91
|
+
def safe_list_sanitizer; end
|
92
|
+
|
93
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#144
|
94
|
+
def safe_list_sanitizer=(_arg0); end
|
95
|
+
|
96
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#154
|
97
|
+
def sanitized_allowed_attributes; end
|
98
|
+
|
99
|
+
# Replaces the allowed HTML attributes for the +sanitize+ helper.
|
100
|
+
#
|
101
|
+
# class Application < Rails::Application
|
102
|
+
# config.action_view.sanitized_allowed_attributes = ['onclick', 'longdesc']
|
103
|
+
# end
|
104
|
+
#
|
105
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#34
|
106
|
+
def sanitized_allowed_attributes=(attributes); end
|
107
|
+
|
108
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#47
|
109
|
+
def sanitized_allowed_css_keywords; end
|
110
|
+
|
111
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#48
|
112
|
+
def sanitized_allowed_css_keywords=(_); end
|
113
|
+
|
114
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#47
|
115
|
+
def sanitized_allowed_css_properties; end
|
116
|
+
|
117
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#48
|
118
|
+
def sanitized_allowed_css_properties=(_); end
|
119
|
+
|
120
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#47
|
121
|
+
def sanitized_allowed_protocols; end
|
122
|
+
|
123
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#48
|
124
|
+
def sanitized_allowed_protocols=(_); end
|
125
|
+
|
126
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#150
|
127
|
+
def sanitized_allowed_tags; end
|
128
|
+
|
129
|
+
# Replaces the allowed tags for the +sanitize+ helper.
|
130
|
+
#
|
131
|
+
# class Application < Rails::Application
|
132
|
+
# config.action_view.sanitized_allowed_tags = 'table', 'tr', 'td'
|
133
|
+
# end
|
134
|
+
#
|
135
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#24
|
136
|
+
def sanitized_allowed_tags=(tags); end
|
137
|
+
|
138
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#47
|
139
|
+
def sanitized_bad_tags; end
|
140
|
+
|
141
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#48
|
142
|
+
def sanitized_bad_tags=(_); end
|
143
|
+
|
144
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#47
|
145
|
+
def sanitized_protocol_separator; end
|
146
|
+
|
147
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#48
|
148
|
+
def sanitized_protocol_separator=(_); end
|
149
|
+
|
150
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#47
|
151
|
+
def sanitized_shorthand_css_properties; end
|
152
|
+
|
153
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#48
|
154
|
+
def sanitized_shorthand_css_properties=(_); end
|
155
|
+
|
156
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#47
|
157
|
+
def sanitized_uri_attributes; end
|
158
|
+
|
159
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#48
|
160
|
+
def sanitized_uri_attributes=(_); end
|
161
|
+
|
162
|
+
# source://actionview/7.1.2/lib/action_view/helpers/sanitize_helper.rb#146
|
163
|
+
def sanitizer_vendor; end
|
164
|
+
|
165
|
+
private
|
166
|
+
|
167
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#52
|
168
|
+
def deprecate_option(name); end
|
169
|
+
end
|
170
|
+
|
171
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer/version.rb#3
|
172
|
+
module Rails
|
173
|
+
class << self
|
174
|
+
# source://railties/7.1.2/lib/rails.rb#42
|
175
|
+
def app_class; end
|
176
|
+
|
177
|
+
# source://railties/7.1.2/lib/rails.rb#42
|
178
|
+
def app_class=(_arg0); end
|
179
|
+
|
180
|
+
# source://railties/7.1.2/lib/rails.rb#43
|
181
|
+
def application; end
|
182
|
+
|
183
|
+
# source://railties/7.1.2/lib/rails.rb#41
|
184
|
+
def application=(_arg0); end
|
185
|
+
|
186
|
+
# source://railties/7.1.2/lib/rails.rb#123
|
187
|
+
def autoloaders; end
|
188
|
+
|
189
|
+
# source://railties/7.1.2/lib/rails.rb#54
|
190
|
+
def backtrace_cleaner; end
|
191
|
+
|
192
|
+
# source://railties/7.1.2/lib/rails.rb#42
|
193
|
+
def cache; end
|
194
|
+
|
195
|
+
# source://railties/7.1.2/lib/rails.rb#42
|
196
|
+
def cache=(_arg0); end
|
197
|
+
|
198
|
+
# source://railties/7.1.2/lib/rails.rb#50
|
199
|
+
def configuration; end
|
200
|
+
|
201
|
+
# source://railties/7.1.2/lib/rails/deprecator.rb#4
|
202
|
+
def deprecator; end
|
203
|
+
|
204
|
+
# source://railties/7.1.2/lib/rails.rb#72
|
205
|
+
def env; end
|
206
|
+
|
207
|
+
# source://railties/7.1.2/lib/rails.rb#79
|
208
|
+
def env=(environment); end
|
209
|
+
|
210
|
+
# source://railties/7.1.2/lib/rails.rb#90
|
211
|
+
def error; end
|
212
|
+
|
213
|
+
# source://railties/7.1.2/lib/rails/gem_version.rb#5
|
214
|
+
def gem_version; end
|
215
|
+
|
216
|
+
# source://railties/7.1.2/lib/rails.rb#103
|
217
|
+
def groups(*groups); end
|
218
|
+
|
219
|
+
# source://railties/7.1.2/lib/rails.rb#47
|
220
|
+
def initialize!(*_arg0, **_arg1, &_arg2); end
|
221
|
+
|
222
|
+
# source://railties/7.1.2/lib/rails.rb#47
|
223
|
+
def initialized?(*_arg0, **_arg1, &_arg2); end
|
224
|
+
|
225
|
+
# source://railties/7.1.2/lib/rails.rb#42
|
226
|
+
def logger; end
|
227
|
+
|
228
|
+
# source://railties/7.1.2/lib/rails.rb#42
|
229
|
+
def logger=(_arg0); end
|
230
|
+
|
231
|
+
# source://railties/7.1.2/lib/rails.rb#119
|
232
|
+
def public_path; end
|
233
|
+
|
234
|
+
# source://railties/7.1.2/lib/rails.rb#63
|
235
|
+
def root; end
|
236
|
+
|
237
|
+
# source://railties/7.1.2/lib/rails/version.rb#7
|
238
|
+
def version; end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer/version.rb#4
|
243
|
+
module Rails::HTML; end
|
244
|
+
|
245
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#193
|
246
|
+
module Rails::HTML4; end
|
247
|
+
|
248
|
+
# == Rails::HTML4::FullSanitizer
|
249
|
+
#
|
250
|
+
# Removes all tags from HTML4 but strips out scripts, forms and comments.
|
251
|
+
#
|
252
|
+
# full_sanitizer = Rails::HTML4::FullSanitizer.new
|
253
|
+
# full_sanitizer.sanitize("<b>Bold</b> no more! <a href='more.html'>See more here</a>...")
|
254
|
+
# # => "Bold no more! See more here..."
|
255
|
+
#
|
256
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#224
|
257
|
+
class Rails::HTML4::FullSanitizer < ::Rails::HTML::Sanitizer
|
258
|
+
include ::Rails::HTML::Concern::ComposedSanitize
|
259
|
+
include ::Rails::HTML::Concern::Parser::HTML4
|
260
|
+
include ::Rails::HTML::Concern::Scrubber::Full
|
261
|
+
include ::Rails::HTML::Concern::Serializer::UTF8Encode
|
262
|
+
end
|
263
|
+
|
264
|
+
# == Rails::HTML4::LinkSanitizer
|
265
|
+
#
|
266
|
+
# Removes +a+ tags and +href+ attributes from HTML4 leaving only the link text.
|
267
|
+
#
|
268
|
+
# link_sanitizer = Rails::HTML4::LinkSanitizer.new
|
269
|
+
# link_sanitizer.sanitize('<a href="example.com">Only the link text will be kept.</a>')
|
270
|
+
# # => "Only the link text will be kept."
|
271
|
+
#
|
272
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#239
|
273
|
+
class Rails::HTML4::LinkSanitizer < ::Rails::HTML::Sanitizer
|
274
|
+
include ::Rails::HTML::Concern::ComposedSanitize
|
275
|
+
include ::Rails::HTML::Concern::Parser::HTML4
|
276
|
+
include ::Rails::HTML::Concern::Scrubber::Link
|
277
|
+
include ::Rails::HTML::Concern::Serializer::UTF8Encode
|
278
|
+
end
|
279
|
+
|
280
|
+
# == Rails::HTML4::SafeListSanitizer
|
281
|
+
#
|
282
|
+
# Sanitizes HTML4 and CSS from an extensive safe list.
|
283
|
+
#
|
284
|
+
# === Whitespace
|
285
|
+
#
|
286
|
+
# We can't make any guarantees about whitespace being kept or stripped. Loofah uses Nokogiri,
|
287
|
+
# which wraps either a C or Java parser for the respective Ruby implementation. Those two
|
288
|
+
# parsers determine how whitespace is ultimately handled.
|
289
|
+
#
|
290
|
+
# When the stripped markup will be rendered the users browser won't take whitespace into account
|
291
|
+
# anyway. It might be better to suggest your users wrap their whitespace sensitive content in
|
292
|
+
# pre tags or that you do so automatically.
|
293
|
+
#
|
294
|
+
# === Options
|
295
|
+
#
|
296
|
+
# Sanitizes both html and css via the safe lists found in
|
297
|
+
# Rails::HTML::Concern::Scrubber::SafeList
|
298
|
+
#
|
299
|
+
# SafeListSanitizer also accepts options to configure the safe list used when sanitizing html.
|
300
|
+
# There's a class level option:
|
301
|
+
#
|
302
|
+
# Rails::HTML4::SafeListSanitizer.allowed_tags = %w(table tr td)
|
303
|
+
# Rails::HTML4::SafeListSanitizer.allowed_attributes = %w(id class style)
|
304
|
+
#
|
305
|
+
# Tags and attributes can also be passed to +sanitize+. Passed options take precedence over the
|
306
|
+
# class level options.
|
307
|
+
#
|
308
|
+
# === Examples
|
309
|
+
#
|
310
|
+
# safe_list_sanitizer = Rails::HTML4::SafeListSanitizer.new
|
311
|
+
#
|
312
|
+
# # default: sanitize via a extensive safe list of allowed elements
|
313
|
+
# safe_list_sanitizer.sanitize(@article.body)
|
314
|
+
#
|
315
|
+
# # sanitize via the supplied tags and attributes
|
316
|
+
# safe_list_sanitizer.sanitize(
|
317
|
+
# @article.body,
|
318
|
+
# tags: %w(table tr td),
|
319
|
+
# attributes: %w(id class style),
|
320
|
+
# )
|
321
|
+
#
|
322
|
+
# # sanitize via a custom Loofah scrubber
|
323
|
+
# safe_list_sanitizer.sanitize(@article.body, scrubber: ArticleScrubber.new)
|
324
|
+
#
|
325
|
+
# # prune nodes from the tree instead of stripping tags and leaving inner content
|
326
|
+
# safe_list_sanitizer = Rails::HTML4::SafeListSanitizer.new(prune: true)
|
327
|
+
#
|
328
|
+
# # the sanitizer can also sanitize CSS
|
329
|
+
# safe_list_sanitizer.sanitize_css('background-color: #000;')
|
330
|
+
#
|
331
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#297
|
332
|
+
class Rails::HTML4::SafeListSanitizer < ::Rails::HTML::Sanitizer
|
333
|
+
include ::Rails::HTML::Concern::ComposedSanitize
|
334
|
+
include ::Rails::HTML::Concern::Parser::HTML4
|
335
|
+
include ::Rails::HTML::Concern::Scrubber::SafeList
|
336
|
+
include ::Rails::HTML::Concern::Serializer::UTF8Encode
|
337
|
+
|
338
|
+
class << self
|
339
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#144
|
340
|
+
def allowed_attributes; end
|
341
|
+
|
342
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#144
|
343
|
+
def allowed_attributes=(_arg0); end
|
344
|
+
|
345
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#143
|
346
|
+
def allowed_tags; end
|
347
|
+
|
348
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#143
|
349
|
+
def allowed_tags=(_arg0); end
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#194
|
354
|
+
module Rails::HTML4::Sanitizer
|
355
|
+
extend ::Rails::HTML4::Sanitizer::VendorMethods
|
356
|
+
end
|
357
|
+
|
358
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#195
|
359
|
+
module Rails::HTML4::Sanitizer::VendorMethods
|
360
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#196
|
361
|
+
def full_sanitizer; end
|
362
|
+
|
363
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#200
|
364
|
+
def link_sanitizer; end
|
365
|
+
|
366
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#204
|
367
|
+
def safe_list_sanitizer; end
|
368
|
+
|
369
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#208
|
370
|
+
def white_list_sanitizer; end
|
371
|
+
end
|
372
|
+
|
373
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#305
|
374
|
+
module Rails::HTML5; end
|
375
|
+
|
376
|
+
# == Rails::HTML5::FullSanitizer
|
377
|
+
#
|
378
|
+
# Removes all tags from HTML5 but strips out scripts, forms and comments.
|
379
|
+
#
|
380
|
+
# full_sanitizer = Rails::HTML5::FullSanitizer.new
|
381
|
+
# full_sanitizer.sanitize("<b>Bold</b> no more! <a href='more.html'>See more here</a>...")
|
382
|
+
# # => "Bold no more! See more here..."
|
383
|
+
#
|
384
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#334
|
385
|
+
class Rails::HTML5::FullSanitizer < ::Rails::HTML::Sanitizer
|
386
|
+
include ::Rails::HTML::Concern::ComposedSanitize
|
387
|
+
include ::Rails::HTML::Concern::Parser::HTML5
|
388
|
+
include ::Rails::HTML::Concern::Scrubber::Full
|
389
|
+
include ::Rails::HTML::Concern::Serializer::UTF8Encode
|
390
|
+
end
|
391
|
+
|
392
|
+
# == Rails::HTML5::LinkSanitizer
|
393
|
+
#
|
394
|
+
# Removes +a+ tags and +href+ attributes from HTML5 leaving only the link text.
|
395
|
+
#
|
396
|
+
# link_sanitizer = Rails::HTML5::LinkSanitizer.new
|
397
|
+
# link_sanitizer.sanitize('<a href="example.com">Only the link text will be kept.</a>')
|
398
|
+
# # => "Only the link text will be kept."
|
399
|
+
#
|
400
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#349
|
401
|
+
class Rails::HTML5::LinkSanitizer < ::Rails::HTML::Sanitizer
|
402
|
+
include ::Rails::HTML::Concern::ComposedSanitize
|
403
|
+
include ::Rails::HTML::Concern::Parser::HTML5
|
404
|
+
include ::Rails::HTML::Concern::Scrubber::Link
|
405
|
+
include ::Rails::HTML::Concern::Serializer::UTF8Encode
|
406
|
+
end
|
407
|
+
|
408
|
+
# == Rails::HTML5::SafeListSanitizer
|
409
|
+
#
|
410
|
+
# Sanitizes HTML5 and CSS from an extensive safe list.
|
411
|
+
#
|
412
|
+
# === Whitespace
|
413
|
+
#
|
414
|
+
# We can't make any guarantees about whitespace being kept or stripped. Loofah uses Nokogiri,
|
415
|
+
# which wraps either a C or Java parser for the respective Ruby implementation. Those two
|
416
|
+
# parsers determine how whitespace is ultimately handled.
|
417
|
+
#
|
418
|
+
# When the stripped markup will be rendered the users browser won't take whitespace into account
|
419
|
+
# anyway. It might be better to suggest your users wrap their whitespace sensitive content in
|
420
|
+
# pre tags or that you do so automatically.
|
421
|
+
#
|
422
|
+
# === Options
|
423
|
+
#
|
424
|
+
# Sanitizes both html and css via the safe lists found in
|
425
|
+
# Rails::HTML::Concern::Scrubber::SafeList
|
426
|
+
#
|
427
|
+
# SafeListSanitizer also accepts options to configure the safe list used when sanitizing html.
|
428
|
+
# There's a class level option:
|
429
|
+
#
|
430
|
+
# Rails::HTML5::SafeListSanitizer.allowed_tags = %w(table tr td)
|
431
|
+
# Rails::HTML5::SafeListSanitizer.allowed_attributes = %w(id class style)
|
432
|
+
#
|
433
|
+
# Tags and attributes can also be passed to +sanitize+. Passed options take precedence over the
|
434
|
+
# class level options.
|
435
|
+
#
|
436
|
+
# === Examples
|
437
|
+
#
|
438
|
+
# safe_list_sanitizer = Rails::HTML5::SafeListSanitizer.new
|
439
|
+
#
|
440
|
+
# # default: sanitize via a extensive safe list of allowed elements
|
441
|
+
# safe_list_sanitizer.sanitize(@article.body)
|
442
|
+
#
|
443
|
+
# # sanitize via the supplied tags and attributes
|
444
|
+
# safe_list_sanitizer.sanitize(
|
445
|
+
# @article.body,
|
446
|
+
# tags: %w(table tr td),
|
447
|
+
# attributes: %w(id class style),
|
448
|
+
# )
|
449
|
+
#
|
450
|
+
# # sanitize via a custom Loofah scrubber
|
451
|
+
# safe_list_sanitizer.sanitize(@article.body, scrubber: ArticleScrubber.new)
|
452
|
+
#
|
453
|
+
# # prune nodes from the tree instead of stripping tags and leaving inner content
|
454
|
+
# safe_list_sanitizer = Rails::HTML5::SafeListSanitizer.new(prune: true)
|
455
|
+
#
|
456
|
+
# # the sanitizer can also sanitize CSS
|
457
|
+
# safe_list_sanitizer.sanitize_css('background-color: #000;')
|
458
|
+
#
|
459
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#407
|
460
|
+
class Rails::HTML5::SafeListSanitizer < ::Rails::HTML::Sanitizer
|
461
|
+
include ::Rails::HTML::Concern::ComposedSanitize
|
462
|
+
include ::Rails::HTML::Concern::Parser::HTML5
|
463
|
+
include ::Rails::HTML::Concern::Scrubber::SafeList
|
464
|
+
include ::Rails::HTML::Concern::Serializer::UTF8Encode
|
465
|
+
|
466
|
+
class << self
|
467
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#144
|
468
|
+
def allowed_attributes; end
|
469
|
+
|
470
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#144
|
471
|
+
def allowed_attributes=(_arg0); end
|
472
|
+
|
473
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#143
|
474
|
+
def allowed_tags; end
|
475
|
+
|
476
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#143
|
477
|
+
def allowed_tags=(_arg0); end
|
478
|
+
end
|
479
|
+
end
|
480
|
+
|
481
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#306
|
482
|
+
class Rails::HTML5::Sanitizer
|
483
|
+
class << self
|
484
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#308
|
485
|
+
def full_sanitizer; end
|
486
|
+
|
487
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#312
|
488
|
+
def link_sanitizer; end
|
489
|
+
|
490
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#316
|
491
|
+
def safe_list_sanitizer; end
|
492
|
+
|
493
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#320
|
494
|
+
def white_list_sanitizer; end
|
495
|
+
end
|
496
|
+
end
|
497
|
+
|
498
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#33
|
499
|
+
module Rails::HTML::Concern; end
|
500
|
+
|
501
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#34
|
502
|
+
module Rails::HTML::Concern::ComposedSanitize
|
503
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#35
|
504
|
+
def sanitize(html, options = T.unsafe(nil)); end
|
505
|
+
end
|
506
|
+
|
507
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#43
|
508
|
+
module Rails::HTML::Concern::Parser; end
|
509
|
+
|
510
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#44
|
511
|
+
module Rails::HTML::Concern::Parser::HTML4
|
512
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#45
|
513
|
+
def parse_fragment(html); end
|
514
|
+
end
|
515
|
+
|
516
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#50
|
517
|
+
module Rails::HTML::Concern::Parser::HTML5
|
518
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#51
|
519
|
+
def parse_fragment(html); end
|
520
|
+
end
|
521
|
+
|
522
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#57
|
523
|
+
module Rails::HTML::Concern::Scrubber; end
|
524
|
+
|
525
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#58
|
526
|
+
module Rails::HTML::Concern::Scrubber::Full
|
527
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#59
|
528
|
+
def scrub(fragment, options = T.unsafe(nil)); end
|
529
|
+
end
|
530
|
+
|
531
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#64
|
532
|
+
module Rails::HTML::Concern::Scrubber::Link
|
533
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#65
|
534
|
+
def initialize; end
|
535
|
+
|
536
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#72
|
537
|
+
def scrub(fragment, options = T.unsafe(nil)); end
|
538
|
+
end
|
539
|
+
|
540
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#77
|
541
|
+
module Rails::HTML::Concern::Scrubber::SafeList
|
542
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#151
|
543
|
+
def initialize(prune: T.unsafe(nil)); end
|
544
|
+
|
545
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#168
|
546
|
+
def sanitize_css(style_string); end
|
547
|
+
|
548
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#155
|
549
|
+
def scrub(fragment, options = T.unsafe(nil)); end
|
550
|
+
|
551
|
+
private
|
552
|
+
|
553
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#177
|
554
|
+
def allowed_attributes(options); end
|
555
|
+
|
556
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#173
|
557
|
+
def allowed_tags(options); end
|
558
|
+
|
559
|
+
class << self
|
560
|
+
# @private
|
561
|
+
#
|
562
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#141
|
563
|
+
def included(klass); end
|
564
|
+
end
|
565
|
+
end
|
566
|
+
|
567
|
+
# The default safe list for attributes
|
568
|
+
#
|
569
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#125
|
570
|
+
Rails::HTML::Concern::Scrubber::SafeList::DEFAULT_ALLOWED_ATTRIBUTES = T.let(T.unsafe(nil), Set)
|
571
|
+
|
572
|
+
# The default safe list for tags
|
573
|
+
#
|
574
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#79
|
575
|
+
Rails::HTML::Concern::Scrubber::SafeList::DEFAULT_ALLOWED_TAGS = T.let(T.unsafe(nil), Set)
|
576
|
+
|
577
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#183
|
578
|
+
module Rails::HTML::Concern::Serializer; end
|
579
|
+
|
580
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#184
|
581
|
+
module Rails::HTML::Concern::Serializer::UTF8Encode
|
582
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#185
|
583
|
+
def serialize(fragment); end
|
584
|
+
end
|
585
|
+
|
586
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#417
|
587
|
+
Rails::HTML::FullSanitizer = Rails::HTML4::FullSanitizer
|
588
|
+
|
589
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#418
|
590
|
+
Rails::HTML::LinkSanitizer = Rails::HTML4::LinkSanitizer
|
591
|
+
|
592
|
+
# === Rails::HTML::PermitScrubber
|
593
|
+
#
|
594
|
+
# +Rails::HTML::PermitScrubber+ allows you to permit only your own tags and/or attributes.
|
595
|
+
#
|
596
|
+
# +Rails::HTML::PermitScrubber+ can be subclassed to determine:
|
597
|
+
# - When a node should be skipped via +skip_node?+.
|
598
|
+
# - When a node is allowed via +allowed_node?+.
|
599
|
+
# - When an attribute should be scrubbed via +scrub_attribute?+.
|
600
|
+
#
|
601
|
+
# Subclasses don't need to worry if tags or attributes are set or not.
|
602
|
+
# If tags or attributes are not set, Loofah's behavior will be used.
|
603
|
+
# If you override +allowed_node?+ and no tags are set, it will not be called.
|
604
|
+
# Instead Loofahs behavior will be used.
|
605
|
+
# Likewise for +scrub_attribute?+ and attributes respectively.
|
606
|
+
#
|
607
|
+
# Text and CDATA nodes are skipped by default.
|
608
|
+
# Unallowed elements will be stripped, i.e. element is removed but its subtree kept.
|
609
|
+
# Supplied tags and attributes should be Enumerables.
|
610
|
+
#
|
611
|
+
# +tags=+
|
612
|
+
# If set, elements excluded will be stripped.
|
613
|
+
# If not, elements are stripped based on Loofahs +HTML5::Scrub.allowed_element?+.
|
614
|
+
#
|
615
|
+
# +attributes=+
|
616
|
+
# If set, attributes excluded will be removed.
|
617
|
+
# If not, attributes are removed based on Loofahs +HTML5::Scrub.scrub_attributes+.
|
618
|
+
#
|
619
|
+
# class CommentScrubber < Rails::HTML::PermitScrubber
|
620
|
+
# def initialize
|
621
|
+
# super
|
622
|
+
# self.tags = %w(form script comment blockquote)
|
623
|
+
# end
|
624
|
+
#
|
625
|
+
# def skip_node?(node)
|
626
|
+
# node.text?
|
627
|
+
# end
|
628
|
+
#
|
629
|
+
# def scrub_attribute?(name)
|
630
|
+
# name == "style"
|
631
|
+
# end
|
632
|
+
# end
|
633
|
+
#
|
634
|
+
# See the documentation for +Nokogiri::XML::Node+ to understand what's possible
|
635
|
+
# with nodes: https://nokogiri.org/rdoc/Nokogiri/XML/Node.html
|
636
|
+
#
|
637
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#49
|
638
|
+
class Rails::HTML::PermitScrubber < ::Loofah::Scrubber
|
639
|
+
# @return [PermitScrubber] a new instance of PermitScrubber
|
640
|
+
#
|
641
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#52
|
642
|
+
def initialize(prune: T.unsafe(nil)); end
|
643
|
+
|
644
|
+
# Returns the value of attribute attributes.
|
645
|
+
#
|
646
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#50
|
647
|
+
def attributes; end
|
648
|
+
|
649
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#62
|
650
|
+
def attributes=(attributes); end
|
651
|
+
|
652
|
+
# Returns the value of attribute prune.
|
653
|
+
#
|
654
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#50
|
655
|
+
def prune; end
|
656
|
+
|
657
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#66
|
658
|
+
def scrub(node); end
|
659
|
+
|
660
|
+
# Returns the value of attribute tags.
|
661
|
+
#
|
662
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#50
|
663
|
+
def tags; end
|
664
|
+
|
665
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#58
|
666
|
+
def tags=(tags); end
|
667
|
+
|
668
|
+
protected
|
669
|
+
|
670
|
+
# @return [Boolean]
|
671
|
+
#
|
672
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#82
|
673
|
+
def allowed_node?(node); end
|
674
|
+
|
675
|
+
# @return [Boolean]
|
676
|
+
#
|
677
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#94
|
678
|
+
def keep_node?(node); end
|
679
|
+
|
680
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#136
|
681
|
+
def scrub_attribute(node, attr_node); end
|
682
|
+
|
683
|
+
# @return [Boolean]
|
684
|
+
#
|
685
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#90
|
686
|
+
def scrub_attribute?(name); end
|
687
|
+
|
688
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#107
|
689
|
+
def scrub_attributes(node); end
|
690
|
+
|
691
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#120
|
692
|
+
def scrub_css_attribute(node); end
|
693
|
+
|
694
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#102
|
695
|
+
def scrub_node(node); end
|
696
|
+
|
697
|
+
# @return [Boolean]
|
698
|
+
#
|
699
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#86
|
700
|
+
def skip_node?(node); end
|
701
|
+
|
702
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#129
|
703
|
+
def validate!(var, name); end
|
704
|
+
end
|
705
|
+
|
706
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#419
|
707
|
+
Rails::HTML::SafeListSanitizer = Rails::HTML4::SafeListSanitizer
|
708
|
+
|
709
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer/version.rb#5
|
710
|
+
class Rails::HTML::Sanitizer
|
711
|
+
extend ::Rails::HTML4::Sanitizer::VendorMethods
|
712
|
+
|
713
|
+
# @raise [NotImplementedError]
|
714
|
+
#
|
715
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#18
|
716
|
+
def sanitize(html, options = T.unsafe(nil)); end
|
717
|
+
|
718
|
+
private
|
719
|
+
|
720
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#28
|
721
|
+
def properly_encode(fragment, options); end
|
722
|
+
|
723
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#23
|
724
|
+
def remove_xpaths(node, xpaths); end
|
725
|
+
|
726
|
+
class << self
|
727
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#13
|
728
|
+
def best_supported_vendor; end
|
729
|
+
|
730
|
+
# @return [Boolean]
|
731
|
+
#
|
732
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#7
|
733
|
+
def html5_support?; end
|
734
|
+
end
|
735
|
+
end
|
736
|
+
|
737
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer/version.rb#6
|
738
|
+
Rails::HTML::Sanitizer::VERSION = T.let(T.unsafe(nil), String)
|
739
|
+
|
740
|
+
# === Rails::HTML::TargetScrubber
|
741
|
+
#
|
742
|
+
# Where +Rails::HTML::PermitScrubber+ picks out tags and attributes to permit in
|
743
|
+
# sanitization, +Rails::HTML::TargetScrubber+ targets them for removal.
|
744
|
+
#
|
745
|
+
# +tags=+
|
746
|
+
# If set, elements included will be stripped.
|
747
|
+
#
|
748
|
+
# +attributes=+
|
749
|
+
# If set, attributes included will be removed.
|
750
|
+
#
|
751
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#171
|
752
|
+
class Rails::HTML::TargetScrubber < ::Rails::HTML::PermitScrubber
|
753
|
+
# @return [Boolean]
|
754
|
+
#
|
755
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#172
|
756
|
+
def allowed_node?(node); end
|
757
|
+
|
758
|
+
# @return [Boolean]
|
759
|
+
#
|
760
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#176
|
761
|
+
def scrub_attribute?(name); end
|
762
|
+
end
|
763
|
+
|
764
|
+
# === Rails::HTML::TextOnlyScrubber
|
765
|
+
#
|
766
|
+
# +Rails::HTML::TextOnlyScrubber+ allows you to permit text nodes.
|
767
|
+
#
|
768
|
+
# Unallowed elements will be stripped, i.e. element is removed but its subtree kept.
|
769
|
+
#
|
770
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#186
|
771
|
+
class Rails::HTML::TextOnlyScrubber < ::Loofah::Scrubber
|
772
|
+
# @return [TextOnlyScrubber] a new instance of TextOnlyScrubber
|
773
|
+
#
|
774
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#187
|
775
|
+
def initialize; end
|
776
|
+
|
777
|
+
# source://rails-html-sanitizer//lib/rails/html/scrubbers.rb#191
|
778
|
+
def scrub(node); end
|
779
|
+
end
|
780
|
+
|
781
|
+
# source://rails-html-sanitizer//lib/rails/html/sanitizer.rb#420
|
782
|
+
Rails::HTML::WhiteListSanitizer = Rails::HTML4::SafeListSanitizer
|
783
|
+
|
784
|
+
# source://rails-html-sanitizer//lib/rails-html-sanitizer.rb#11
|
785
|
+
Rails::Html = Rails::HTML
|