This commit is contained in:
Thomas Reynolds 2014-08-24 11:36:42 -07:00
commit 07ac578a31
7 changed files with 29 additions and 6 deletions

View file

@ -18,6 +18,17 @@ Feature: YAML Front Matter
Then I should see "<?php"
Then I should not see "---"
Scenario: Rendering markdown (template-less) (yaml)
Given the Server is running at "frontmatter-app"
When I go to "/front-matter-pandoc.html"
Then I should see ">This is a document</h1>"
Then I should see "<p>To be or not to be</p>"
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"

View file

@ -78,4 +78,4 @@ Feature: Support slim templating language
When I go to "/sass.html"
Then I should see "html,body,div"
When I go to "/error.html"
Then I should see "Syntax error"
Then I should see "Error: Invalid"

View file

@ -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 %>.

View file

@ -115,7 +115,7 @@ module Middleman::CoreExtensions
# @return [Array<Hash, String>]
Contract String, Pathname => Maybe[[Hash, String]]
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, '')

View file

@ -16,8 +16,6 @@ class Middleman::Extensions::AutomaticImageSizes < ::Middleman::Extension
# @return [String]
def image_tag(path, params={})
if !params.key?(:width) && !params.key?(:height) && !path.include?('://')
params[:alt] ||= ''
real_path = path.dup
real_path = File.join(config[:images_dir], real_path) unless real_path.start_with?('/')

View file

@ -87,7 +87,7 @@ module Middleman
begin
@engine.render
rescue ::Sass::SyntaxError => e
::Sass::SyntaxError.exception_to_css(e, full_exception: true)
::Sass::SyntaxError.exception_to_css(e)
end
end

View file

@ -22,7 +22,8 @@ Gem::Specification.new do |s|
s.add_dependency('middleman-cli', Middleman::VERSION)
# s.add_dependency('middleman-sprockets', '>= 3.1.2') Disabled in alphas
# s.add_dependency('middleman-compass', '4.0.0.alpha.2')
s.add_dependency('sass', ['>= 3.3.0'])
s.add_dependency('sass', ['>= 3.4.0', '< 4.0'])
s.add_dependency('compass-import-once', ['1.0.5'])
s.add_dependency('haml', ['>= 4.0.5'])
s.add_dependency('coffee-script', ['~> 2.2'])
s.add_dependency('kramdown', ['~> 1.2'])