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

Convert :whitespace_elements into a Hash. #94

Closed
wants to merge 1 commit into from
Closed

Convert :whitespace_elements into a Hash. #94

wants to merge 1 commit into from

Conversation

alperkokmen
Copy link
Contributor

This will let developers to configure Sanitize to specify the
replacements for :whitespace_elements found in the input. Previously,
developers couldn't specify the text to be inserted before and after
the :whitespace_elements.

  • updated :whitespace_elements to be a Hash rather than an Array.
  • updated CleanElement#call to use appropriate replacements for the
    element found instead of hardcoded space (' ').
  • made sure existing tests were not broken and added new tests for the
    functionality added by overriding replacement values for tags.
  • updated README to reflect these changes.

NOTE: Changes are backwards compatible. Code will detect Array types
and will convert them into the new Hash format.

This will let developers to configure Sanitize to specify the
replacements for :whitespace_elements found in the input. Previously,
developers couldn't specify the text to be inserted before and after
the :whitespace_elements.

- updated :whitespace_elements to be a Hash rather than an Array.
- updated CleanElement#call to use appropriate replacements for the
  element found instead of hardcoded space (' ').
- made sure existing tests were not broken and added new tests for the
  functionality added by overriding replacement values for tags.
- updated README to reflect these changes.

NOTE: Changes are backwards compatible. Code will detect Array types
and will convert them into the new Hash format.
@rgrove
Copy link
Owner

rgrove commented Feb 1, 2014

I like it! Thanks for the nice clean PR and tests. :)

@rgrove
Copy link
Owner

rgrove commented Feb 1, 2014

Merged into the dev-2.2.0 branch.

@rgrove rgrove closed this Feb 1, 2014
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

Successfully merging this pull request may close these issues.

2 participants