| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
These tests were failing due to backwards incompatible changes, as apart
of the v1.0.3 release of rails-html-sanitizer.
|
|
|
|
|
|
|
|
|
|
|
| |
The pluralize text helper uses the Inflector to determine the plural
form. The inflector accepts an optional parameter for the locale,
so we can pass it from the text helper to have locale-aware pluralizations
on the text helpers level.
The pluralize text helper now only accepts 2 positional arguments:
`count` and `singular`. Passing `plural` as a positional argument
is now deprecated.
|
|
|
|
|
|
|
|
|
|
| |
today the only option we have is "\n" and is hardcoded.
With this change you will be able to specify any break sequence ("\r\n" for example) as an option.
adding proper documentation for break_sequence in ActionView::Helpers::TextHelper.word_wrap
adding some more documentation for word_wrap custom break sequence and making sure we use new hash syntax
|
|
|
|
| |
This is already supported in `ActiveSupport::Inflector#pluralize` and `String#pluralize`, so we just forward the locale.
|
|
|
|
| |
onwards.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
Loofah-integration
Conflicts:
actionpack/CHANGELOG.md
actionview/CHANGELOG.md
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Original implementation has bugs if the regex contains a match group.
Example:
excerpt('This is a beautiful? morning', /\b(beau\w*)\b/i, :radius => 5)
Expected: "...is a beautiful? mor..."
Actual: "...is a beautifulbeaut..."
The original phrase was being converted to a regex and returning the text
either side of the phrase as expected:
'This is a beautiful? morning'.split(/beautiful/i, 2)
# => ["This is a ", "? morning"]
When we have a match with groups the match is returned in the array.
Quoting the ruby docs: "If pattern is a Regexp, str is divided where the
pattern matches. [...] If pattern contains groups, the respective matches will
be returned in the array as well."
'This is a beautiful? morning'.split(/\b(beau\w*)\b/iu, 2)
# => ["This is a ", "beautiful", "? morning"]
If we assume we want to split on the first match – this fix makes that
assumption – we can pass the already assigned `phrase` variable as the place
to split (because we already know that a match exists from line 168).
Originally spotted by Louise Crow (@crowbot) at
https://github.com/mysociety/alaveteli/pull/1557
|
| |
| |
| |
| |
| |
| |
| |
| | |
The helper will yield each matched word, and you can use this instead of the
':highlighter' option for more complex replacing logic:
highlight('My email is me@work.com', EMAIL_REGEXP) { |m| mail_to(m) }
# => 'My email is <a href="mailto:me@work.com">me@work.com</a>'
|
| | |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| | |
Cycle object should accept an array
Conflicts:
actionview/CHANGELOG.md
|
| |
| |
| |
| | |
with a set of comma-separated objects.
|
|/ |
|
| |
|
| |
|
|
|
|
|
| |
* replaced String concatenation by joining
* separator has default value to '', even it is nil
|
|
|