1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test
Sean Doyle d2e07395b3 ActionView: Serialize Regexp into HTML attribute
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
2020-11-26 17:52:26 -05:00
..
actionpack Remove an unused Action View test fixture 2020-11-01 23:25:29 +00:00
activerecord Address to false negative for Performance/DeletePrefix,DeleteSuffix 2020-06-14 13:04:47 +09:00
fixtures Remove an unused Action View test fixture 2020-11-01 23:25:29 +00:00
lib Include layout when rendering objects from controllers 2020-10-14 11:49:45 -06:00
template ActionView: Serialize Regexp into HTML attribute 2020-11-26 17:52:26 -05:00
ujs Remove jquery metadata 2020-11-08 19:27:35 +06:00
abstract_unit.rb Merge pull request #39939 from Shopify/link-preload-headers 2020-08-17 08:37:22 -04:00
active_record_unit.rb Module#const_set is a public method 2020-09-15 17:19:37 +09:00