Compare commits

...

3 Commits

Author SHA1 Message Date
Joseph Wynn
959f5abdc0
1.5.5 2020-04-06 21:58:11 +12:00
Joseph Wynn
f49726affc
Automatically convert tabbed indentation to spaces 2020-04-06 21:57:43 +12:00
Joseph Wynn
682beff7b5
1.5.4 2020-01-17 11:35:18 +13:00
3 changed files with 22 additions and 2 deletions

View File

@ -13,6 +13,20 @@ Feature: Jekyll responsive_image_block tag
When I run Jekyll
Then I should see "<img alt=\"Lorem ipsum\" src=\"/assets/everybody-loves-jalapeño-pineapple-cornbread.png\" title=\"Magic rainbow adventure!\"" in "_site/index.html"
Scenario: Tabs for indentation
Given I have a responsive_image configuration with "template" set to "_includes/responsive-image.html"
And I have a file "index.html" with:
"""
{% assign path = 'assets/everybody-loves-jalapeño-pineapple-cornbread.png' %}
{% responsive_image_block %}
path: {{ path }}
title: Magic rainbow adventure!
alt: Lorem ipsum
{% endresponsive_image_block %}
"""
When I run Jekyll
Then I should see "<img alt=\"Lorem ipsum\" src=\"/assets/everybody-loves-jalapeño-pineapple-cornbread.png\" title=\"Magic rainbow adventure!\"" in "_site/index.html"
Scenario: Global variables available in templates
Given I have a file "index.html" with:
"""

View File

@ -4,7 +4,13 @@ module Jekyll
include Jekyll::ResponsiveImage::Utils
def render(context)
attributes = YAML.load(super)
content = super
if content.include?("\t")
content = content.lines.map {|line| line.gsub(/\G[\t ]/, " ")}.join("\n")
end
attributes = YAML.load(content)
Renderer.new(context.registers[:site], attributes).render_responsive_image
end
end

View File

@ -1,5 +1,5 @@
module Jekyll
module ResponsiveImage
VERSION = '1.5.3'.freeze
VERSION = '1.5.5'.freeze
end
end