diff --git a/middleman-core/features/front-matter.feature b/middleman-core/features/front-matter.feature index a0440f55..4625906f 100644 --- a/middleman-core/features/front-matter.feature +++ b/middleman-core/features/front-matter.feature @@ -21,6 +21,17 @@ Feature: YAML Front Matter Then I should see "This is a document" + Then I should see "

To be or not to be

" + Then I should see "The meaning of life is 42" + Then I should not see "..." + Then I should not see "layout: false" + Then I should not see "title: Pandoc likes trailing dots..." + + Scenario: YAML not on first line, no encoding Given the Server is running at "frontmatter-app" When I go to "/front-matter-line-2.html" diff --git a/middleman-core/fixtures/frontmatter-app/source/front-matter-pandoc.html.md.erb b/middleman-core/fixtures/frontmatter-app/source/front-matter-pandoc.html.md.erb new file mode 100644 index 00000000..b800a11b --- /dev/null +++ b/middleman-core/fixtures/frontmatter-app/source/front-matter-pandoc.html.md.erb @@ -0,0 +1,13 @@ +--- +layout: false +title: Pandoc likes trailing dots... +dotty_string: "..." +famous_quote: To be or not to be +popular_number: 42 +... + +# This is a document + +<%= current_page.data.famous_quote %> + +The meaning of life is <%= current_page.data.popular_number %>. diff --git a/middleman-core/lib/middleman-core/core_extensions/front_matter.rb b/middleman-core/lib/middleman-core/core_extensions/front_matter.rb index b9f09647..ac683db7 100644 --- a/middleman-core/lib/middleman-core/core_extensions/front_matter.rb +++ b/middleman-core/lib/middleman-core/core_extensions/front_matter.rb @@ -119,7 +119,7 @@ module Middleman::CoreExtensions # @param [String] content # @return [Array] def parse_yaml_front_matter(content, full_path) - yaml_regex = /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m + yaml_regex = /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m if content =~ yaml_regex content = content.sub(yaml_regex, '')