app/search_engines/bento_search/eds_engine.rb
# If EDS has put highlighting tags
# in a field, we need to HTML escape the literal values,
# while still using the highlighting tokens to put
# HTML tags around highlighted terms.
#
# Second param, if to assume EDS literals are safe HTML, as they
# seem to be. 
If EDS has put highlighting tags
in a field, we need to HTML escape the literal values,
while still using the highlighting tokens to put
HTML tags around highlighted terms.

Second param, if to assume EDS literals are safe HTML, as they
seem to be.
If EDS has put highlighting tags in a field we need to HTML escape the literal values while still using the highlighting tokens to put HTML tags around highlighted terms . Second param if to assume EDS literals are safe HTML as they seem to be .
def prepare_eds_payload(str, html_safe = false)
    return str if str.blank?
    unless configuration.highlighting
      str = str.html_safe if html_safe  
      return str
    end
    parts = 
    str.split(%r{(</?highlight>)}).collect do |substr|
      case substr
      when "<highlight>" then "<b class='bento_search_highlight'>".html_safe
      when "</highlight>" then "</b>".html_safe
      else substr.html_safe
      end
    end
    return helper.safe_join(parts, '')        
  end
def prepare_eds_payload ( str , html_safe = false ) return str if str . blank? unless configuration . highlighting str = str . html_safe if html_safe return str end parts = str . split ( %r{ (</?highlight>) } ) . collect do | substr | case substr when "<highlight>" then "<b class='bento_search_highlight'>" . html_safe when "</highlight>" then "</b>" . html_safe else substr . html_safe end end return helper . safe_join ( parts , '' ) end
If EDS has put highlighting tags
in a field, we need to HTML escape the literal values,
while still using the highlighting tokens to put
HTML tags around highlighted terms.
If EDS has put highlighting tags in a field we need to HTML escape the literal values while still using the highlighting tokens to put HTML tags around highlighted terms .
# Yes, EDS gives us HTML in the literals, we're choosing to trust it. 
str
<not_specific>
html_safe
<not_specific>