diff --git a/CHANGELOG.md b/CHANGELOG.md index 69b33caa..26836c95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ master * Include middleman-livereload in default Gemfile * Update Rack dependency to 1.5.x * Update to Listen 1.0.x +* Update to padrino-helpers 0.11.x 3.1.0.beta.1 === diff --git a/middleman-core/lib/middleman-core/core_extensions/rendering.rb b/middleman-core/lib/middleman-core/core_extensions/rendering.rb index 868e3214..3b6e966a 100644 --- a/middleman-core/lib/middleman-core/core_extensions/rendering.rb +++ b/middleman-core/lib/middleman-core/core_extensions/rendering.rb @@ -25,6 +25,8 @@ module Middleman ::Tilt.mappings.delete('html') # WTF, Tilt? ::Tilt.mappings.delete('csv') + require 'active_support/core_ext/string/output_safety' + # Activate custom renderers require "middleman-core/renderers/erb" app.register Middleman::Renderers::ERb @@ -274,7 +276,9 @@ module Middleman content = callback.call(content, path, locs, template_class) end - return content + output = ::ActiveSupport::SafeBuffer.new + output.safe_concat content + output ensure # Reset stored buffer @_out_buf = _buf_was @@ -408,7 +412,7 @@ module Middleman @_out_buf = _buf_was end - concat_content render_individual_file(layout_path, @current_locs || {}, @current_opts || {}, self) { content } + concat_safe_content render_individual_file(layout_path, @current_locs || {}, @current_opts || {}, self) { content } ensure @current_engine = engine_was end diff --git a/middleman-core/lib/middleman-core/renderers/slim.rb b/middleman-core/lib/middleman-core/renderers/slim.rb index 891bfe76..cb6441e8 100644 --- a/middleman-core/lib/middleman-core/renderers/slim.rb +++ b/middleman-core/lib/middleman-core/renderers/slim.rb @@ -19,7 +19,9 @@ module Middleman # Setup Slim options to work with partials ::Slim::Engine.set_default_options( :buffer => '@_out_buf', - :generator => ::Temple::Generators::StringBuffer + :use_html_safe => true, + :generator => ::Temple::Generators::RailsOutputBuffer, + :disable_escape => true ) app.after_configuration do diff --git a/middleman-core/middleman-core.gemspec b/middleman-core/middleman-core.gemspec index 45f9e372..a86cadfa 100644 --- a/middleman-core/middleman-core.gemspec +++ b/middleman-core/middleman-core.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |s| s.add_dependency("rack-test", ["~> 0.6.1"]) # CLI - s.add_dependency("thor", ["~> 0.15.4"]) + s.add_dependency("thor", ["~> 0.17.0"]) # Helpers s.add_dependency("activesupport", ["~> 3.2.6"]) diff --git a/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb b/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb index ff42a55a..9439d4a7 100644 --- a/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb +++ b/middleman-more/lib/middleman-more/core_extensions/default_helpers.rb @@ -13,6 +13,8 @@ class Middleman::CoreExtensions::DefaultHelpers < ::Middleman::Extension app.helpers ::Padrino::Helpers::FormatHelpers app.helpers ::Padrino::Helpers::RenderHelpers app.helpers ::Padrino::Helpers::NumberHelpers + # app.helpers ::Padrino::Helpers::TranslationHelpers + app.helpers ::Padrino::Helpers::Breadcrumbs app.config.define_setting :relative_links, false, 'Whether to generate relative links instead of absolute ones' end diff --git a/middleman-more/middleman-more.gemspec b/middleman-more/middleman-more.gemspec index b6f9cd7d..5d10f303 100644 --- a/middleman-more/middleman-more.gemspec +++ b/middleman-more/middleman-more.gemspec @@ -25,5 +25,5 @@ Gem::Specification.new do |s| s.add_dependency("execjs", ["~> 1.4.0"]) s.add_dependency("kramdown", ["~> 1.0.0"]) s.add_dependency("i18n", ["~> 0.6.4"]) - s.add_dependency("padrino-helpers", ["0.10.7"]) + s.add_dependency("padrino-helpers", ["0.11.1"]) end \ No newline at end of file