Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Page search & character strip #35

Merged
merged 4 commits into from
May 14, 2015
Merged

Conversation

mikeybeck
Copy link
Contributor

Updated readme to document page search.
Added a plugin to strip characters that will cause invalid JSON.

(Sorry about the use of a plugin; I'm new to Ruby & Jekyll, and couldn't figure out a better way to remove some characters from the JSON)

class String
def strip_control_and_extended_characters()
chars.each_with_object("") do |char, str|
str << char if char.ascii_only? and char.ord.between?(32,126)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use && instead of and.
Space missing after comma.

@mikeybeck mikeybeck closed this May 14, 2015
@mikeybeck mikeybeck reopened this May 14, 2015
christian-fei added a commit that referenced this pull request May 14, 2015
Page search & character strip
@christian-fei christian-fei merged commit 37bfe86 into christian-fei:master May 14, 2015
@christian-fei
Copy link
Owner

Thank you very much!! :)

@mikeybeck
Copy link
Contributor Author

No worries, thank you for making this!

@daviddarnes
Copy link
Contributor

Doesn't the jsonify filter in liquid do this anyway? This .rb file won't be useable on Jekyll sites hosted with GitHub Pages.

@mikeybeck
Copy link
Contributor Author

Oh man I can't believe I missed that! What an idiot. Ok I'll confirm the jsonify filter works and remove the plugin

@daviddarnes
Copy link
Contributor

@mikeybeck great stuff, thanks for taking the time to contribute :)

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

Successfully merging this pull request may close these issues.

None yet

4 participants