mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
strip_links is case-insensitive. Closes #6285.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5191 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
82558186a3
commit
c554a9caba
3 changed files with 4 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* strip_links is case-insensitive. #6285 [tagoh, Bob Silva]
|
||||
|
||||
* Clear the cache of possible controllers whenever Routes are reloaded. [Nicholas Seckar]
|
||||
|
||||
* Filters overhaul including meantime filter support using around filters + blocks. #5949 [Martin Emde, Roman Le Negrate, Stefan Kaes, Jeremy Kemper]
|
||||
|
|
|
@ -152,7 +152,7 @@ module ActionView
|
|||
|
||||
# Turns all links into words, like "<a href="something">else</a>" to "else".
|
||||
def strip_links(text)
|
||||
text.gsub(/<a\b.*?>(.*?)<\/a>/m, '\1')
|
||||
text.gsub(/<a\b.*?>(.*?)<\/a>/mi, '\1')
|
||||
end
|
||||
|
||||
# Try to require the html-scanner library
|
||||
|
|
|
@ -51,6 +51,7 @@ class TextHelperTest < Test::Unit::TestCase
|
|||
|
||||
def test_strip_links
|
||||
assert_equal "on my mind", strip_links("<a href='almost'>on my mind</a>")
|
||||
assert_equal "on my mind", strip_links("<A href='almost'>on my mind</A>")
|
||||
end
|
||||
|
||||
def test_highlighter
|
||||
|
|
Loading…
Reference in a new issue