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 |
||
---|---|---|
.. | ||
actionpack | ||
activerecord | ||
fixtures | ||
lib | ||
template | ||
ujs | ||
abstract_unit.rb | ||
active_record_unit.rb |