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

kramdown: symbolize keys in-place #6247

Merged
merged 4 commits into from Jul 28, 2017
Merged

kramdown: symbolize keys in-place #6247

merged 4 commits into from Jul 28, 2017

Conversation

parkr
Copy link
Member

@parkr parkr commented Jul 26, 2017

Currently-released version of Jekyll uses default_proc to assign values for the kramdown config. Kramdown::Document#initialize calls Options.merge which does Hash#each over our hash which doesn't have symbolized keys. To fix this, we need to add the symbolized keys into the hash itself.

Fixes #5980.

/cc @jekyll/stability

@jekyllbot jekyllbot assigned jekyllbot and ghost Jul 26, 2017
@parkr parkr added the fix label Jul 26, 2017
@parkr parkr assigned pathawks and unassigned jekyllbot Jul 26, 2017
@parkr parkr requested review from pathawks and a user July 26, 2017 22:38
Copy link
Member

@suriyaa suriyaa left a comment

Choose a reason for hiding this comment

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

👌

Copy link
Member

@pathawks pathawks left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Hash
)
hash.keys.each do |key|
hash[key.to_sym] = hash[key]
Copy link
Member

Choose a reason for hiding this comment

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

hash[key.to_sym] = hash[key] unless key.is_a?(Symbol)

?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should be a no-op since Symbol#to_sym returns self, right?

@parkr
Copy link
Member Author

parkr commented Jul 28, 2017

@jekyllbot: merge +fix

@jekyllbot jekyllbot merged commit 143367c into master Jul 28, 2017
@jekyllbot jekyllbot deleted the kramdown-configs branch July 28, 2017 16:05
jekyllbot added a commit that referenced this pull request Jul 28, 2017
@parkr parkr mentioned this pull request Aug 12, 2017
6 tasks
parkr added a commit that referenced this pull request Aug 12, 2017
parkr added a commit that referenced this pull request Aug 12, 2017
Backport #6247 for v3.5.x: kramdown: symbolize keys in-place
@jekyll jekyll locked and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kramdown GFM is not enable?
5 participants