Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for sanitize to whitelist specific characters #349

Open
wahlg opened this issue Apr 24, 2019 · 0 comments
Open

Option for sanitize to whitelist specific characters #349

wahlg opened this issue Apr 24, 2019 · 0 comments

Comments

@wahlg
Copy link

wahlg commented Apr 24, 2019

  • Rails version: 4.2.7.1
  • Algolia Rails integration version: 1.15.1
  • Algolia Client Version: 1.11.0
  • Language Version: 2.3.8

Description

Would it be possible to add more features for attribute sanitization, or to allow a custom sanitizer to be passed in? Right now it looks like the only supported option is sanitize: true which performs full HTML sanitization on all attributes:

::HTML::FullSanitizer.new

Specifically, I'm interested in the ability to whitelist the & character since it is getting indexed as & in Algolia when included in a string attribute.

Steps To Reproduce

Add sanitize: true to the list of options passed to algoliasearch. Create an attribute that has an ampersand:

  attribute :some_attribute do
    'This & That'
  end

Index the record and see it shows up as This & That

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant