diff --git a/features/include_tag.feature b/features/include_tag.feature index cab01187..83ae379f 100644 --- a/features/include_tag.feature +++ b/features/include_tag.feature @@ -89,3 +89,11 @@ Feature: Include tags Then I have an "_includes/one.html" file that contains "include content changed" When I run jekyll build Then I should see "include content changed" in "_site/index.html" + + Scenario: Include a file with multiple variables + Given I have an _includes directory + And I have an "_includes/header-en.html" file that contains "include" + And I have an "index.html" page that contains "{% assign name = 'header' %}{% assign locale = 'en' %}{% include {{name}}-{{locale}}.html %}" + When I run jekyll build + Then the _site directory should exist + And I should see "include" in "_site/index.html" diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index 0e944407..2e39738e 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -16,7 +16,7 @@ module Jekyll attr_reader :includes_dir VALID_SYNTAX = /([\w-]+)\s*=\s*(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w\.-]+))/ - VARIABLE_SYNTAX = /(?[^{]*\{\{\s*(?[\w\-\.]+)\s*(\|.*)?\}\}[^\s}]*)(?.*)/ + VARIABLE_SYNTAX = /(?[^{]*(\{\{\s*[\w\-\.]+\s*(\|.*)?\}\}[^\s{}]*)+)(?.*)/ def initialize(tag_name, markup, tokens) super