mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
d2e07395b3
When serializing a Regexp instance, encode the [Regexp#source][]. When encoding a value into a [pattern][] attribute from ERB/Ruby, declaring the String can be tedious. For example, one might attempt to encode `\w+` as `"\\\w+"`, but once serialized to the browser, that is not equivalent to the `"\w+"` HTML attribute. Instead, enable declaring Regexp and Regexp literals as attributes, and encoding them as their source String. [Regexp#source]: https://ruby-doc.org/core-2.7.2/Regexp.html#method-i-source [pattern]: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern |
||
---|---|---|
.. | ||
helpers | ||
locale | ||
renderer | ||
tasks | ||
template | ||
testing | ||
base.rb | ||
buffers.rb | ||
cache_expiry.rb | ||
context.rb | ||
dependency_tracker.rb | ||
digestor.rb | ||
flows.rb | ||
gem_version.rb | ||
helpers.rb | ||
layouts.rb | ||
log_subscriber.rb | ||
lookup_context.rb | ||
model_naming.rb | ||
path_set.rb | ||
railtie.rb | ||
record_identifier.rb | ||
rendering.rb | ||
routing_url_for.rb | ||
template.rb | ||
test_case.rb | ||
unbound_template.rb | ||
version.rb | ||
view_paths.rb |