Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Integrate with Convertible#do_layout

  • Loading branch information...
commit e3c7bd6bd6e8039dfdedeab952896fee2476e765 1 parent abca390
Jan-Yves Ruzicka authored
Showing with 12 additions and 4 deletions.
  1. +1 −0  lib/jekyll.rb
  2. +10 −3 lib/jekyll/convertible.rb
  3. +1 −1  test/test_post.rb
View
1  lib/jekyll.rb
@@ -31,6 +31,7 @@ def require_all(path)
require 'jekyll/site'
require 'jekyll/convertible'
require 'jekyll/layout'
+require 'jekyll/liquid_encoder'
require 'jekyll/page'
require 'jekyll/post'
require 'jekyll/draft'
View
13 lib/jekyll/convertible.rb
@@ -77,6 +77,15 @@ def do_layout(payload, layouts)
payload["pygments_prefix"] = converter.pygments_prefix
payload["pygments_suffix"] = converter.pygments_suffix
+ # Initialise the LiquidEncoder and encode text
+ encoder = Jekyll::LiquidEncoder.new(content)
+ self.content = encoder.encoded_content
+
+ # # Run transformation and decode Liquid
+ self.transform
+ self.content = encoder.decode(self.content)
+
+ # Run liquid
begin
self.content = Liquid::Template.parse(self.content).render!(payload, info)
rescue => e
@@ -86,9 +95,7 @@ def do_layout(payload, layouts)
end
abort("Build Failed")
end
-
- self.transform
-
+
# output keeps track of what will finally be written
self.output = self.content
View
2  test/test_post.rb
@@ -468,7 +468,7 @@ def do_render(post)
post.site.source = File.join(File.dirname(__FILE__), 'source')
do_render(post)
- assert_equal "<<< <hr />\n<p>Tom Preston-Werner github.com/mojombo</p>\n\n<p>This <em>is</em> cool</p> >>>", post.output
+ assert_equal "<<< <hr />\n<p>Tom Preston-Werner github.com/mojombo</p>\n<p>This <em>is</em> cool</p> >>>", post.output
end
should "render date specified in front matter properly" do
Please sign in to comment.
Something went wrong with that request. Please try again.