Skip to content
New issue

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

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

Already on GitHub? # to your account

Guard against empty title or description strings #206

Merged
merged 4 commits into from
May 5, 2017

Conversation

benbalter
Copy link
Collaborator

An alternate approach to #204 and to address the comments on 4f80ea5#commitcomment-22010563, this PR defensively codes against title or description on the site or page level being an empty string.

The problem is if a value is "", page["key"] will return "", but format_string(page["key"]) will return nil, meaning format_string(page["key"]) + "s" if page["key"] while intuitively right, will cause an unknown method or no implicit conversion error because "" is truthy in Ruby.

Copy link
Member

@parkr parkr left a comment

Choose a reason for hiding this comment

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

❤️

@benbalter
Copy link
Collaborator Author

@jekyllbot: merge +minor.

@benbalter benbalter merged commit f2e788e into master May 5, 2017
@benbalter benbalter deleted the guard-against-empty-strings branch May 5, 2017 18:22
benbalter added a commit that referenced this pull request May 5, 2017
@jekyll jekyll locked and limited conversation to collaborators Apr 30, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants