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

Replace interpolated interpolation with cleaner method #965

Merged
merged 1 commit into from Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
# Haml Changelog

* Performance/memory improvement in `lib/haml/util.rb` that saves a string allocation [#965](https://github.com/haml/haml/pull/965) (thanks [Dillon Welch](https://github.com/oniofchaos))
* Add constant for default options in `lib/haml/helpers/action_view_mods.rb` [#966](https://github.com/haml/haml/pull/966) (thanks [Dillon Welch](https://github.com/oniofchaos))
* Performance/memory usage improvement in `lib/haml/buffer.rb` [#963](https://github.com/haml/haml/pull/963) (thanks [Dillon Welch](https://github.com/oniofchaos))
* Add erubis to gemspec so that `benchmark.rb` works [#964](https://github.com/haml/haml/pull/964) (thanks [Dillon Welch](https://github.com/oniofchaos))
Expand Down
2 changes: 1 addition & 1 deletion lib/haml/util.rb
Expand Up @@ -212,7 +212,7 @@ def unescape_interpolation(str, escape_html = nil)
else
scan.scan(/\w+/)
end
content = eval('"' + interpolated + '"')
content = eval("\"#{interpolated}\"")
content.prepend(char) if char == '@' || char == '$'
content = "Haml::Helpers.html_escape((#{content}))" if escape_html

Expand Down