Highlight (ActionView::Helpers::TextHelper)

I’m using that helper function with a search form to highlight the
typed phrase in the content BUT when my content is HTML, I’ll get
replacement where I don’t want to.

For instance :

@page.content = “

My text containing AJAX

What I get :
highlight (@page.content, ‘ajax’)

=>

<span
class="highlight">Ajax</span> ImageMy text containing ajax

What I want to get :
highlight (@page.content, ‘ajax’)

=>

My text containing ajax

Don’t know much to RegExp, is this possible to do ?

On Sep 5, 2006, at 1:45 AM, [email protected] wrote:

I’m using that helper function with a search form to highlight the
typed phrase in the content BUT when my content is HTML, I’ll get
replacement where I don’t want to.

You want to ask this question on the Rails mailing list. This list
is for general ruby questions.


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com