middleman/middleman — pull request #849 by stevenosloan (2013-04-04 19:26:27+00:00)
Title: Markdown filter support for Haml 4

in response to https://github.com/middleman/middleman/issues/662#issuecomment-15880076

This is just the failing tests, seems like the app context isn't being passed to hamls markdown filter:

relevant output from the tests:

```bash
Scenario: Markdown filter in Haml uses our link_to and image_tag helpers # middleman-more/features/markdown_redcarpet_in_haml.feature:25
Given a fixture app "markdown-in-haml-app" # middleman-core/lib/middleman-core/step_definitions/builder_steps.rb:19
And a file named "config.rb" with: # aruba-0.5.1/lib/aruba/cucumber.rb:19
"""
set :markdown_engine, :redcarpet
activate :directory_indexes
"""
And a file named "source/link_and_image.html.haml" with: # aruba-0.5.1/lib/aruba/cucumber.rb:19
"""
:markdown
[A link](/link_target.html)

![image](blank.gif)
"""
Given the Server is running at "markdown-in-haml-app" # middleman-core/lib/middleman-core/step_definitions/server_steps.rb:60
When I go to "/link_and_image/" # middleman-core/lib/middleman-core/step_definitions/server_steps.rb:65
undefined method `link_to' for # (NoMethodError)
./middleman-core/lib/middleman-core/renderers/redcarpet.rb:62:in `link'
./middleman-core/lib/middleman-core/renderers/redcarpet.rb:49:in `evaluate'
(eval):5:in `render_with_options'
./middleman-core/lib/middleman-core/core_extensions/rendering.rb:260:in `block in render_individual_file'
./middleman-core/lib/middleman-core/util.rb:157:in `fetch'
./middleman-core/lib/middleman-core/core_extensions/rendering.rb:259:in `render_individual_file'
./middleman-core/lib/middleman-core/core_extensions/rendering.rb:148:in `render_template'
./middleman-core/lib/middleman-core/sitemap/resource.rb:128:in `block in render'
./middleman-core/lib/middleman-core/util.rb:60:in `instrument'
./middleman-core/lib/middleman-core/application.rb:222:in `instrument'
./middleman-core/lib/middleman-core/sitemap/resource.rb:14:in `instrument'
./middleman-core/lib/middleman-core/sitemap/resource.rb:114:in `render'
./middleman-core/lib/middleman-core/core_extensions/request.rb:255:in `process_request'
./middleman-core/lib/middleman-core/core_extensions/request.rb:204:in `block in call!'
./middleman-core/lib/middleman-core/core_extensions/request.rb:203:in `catch'
./middleman-core/lib/middleman-core/core_extensions/request.rb:203:in `call!'
./middleman-core/lib/middleman-core/core_extensions/request.rb:188:in `call'
./middleman-core/lib/middleman-core/step_definitions/server_steps.rb:66:in `/^I go to "([^\"]*)"$/'
middleman-more/features/markdown_redcarpet_in_haml.feature:40:in `When I go to "/link_and_image/"'
Then I should see "/link_target/" # middleman-core/lib/middleman-core/step_definitions/server_steps.rb:73
Then I should see 'src="/images/blank.gif"' # middleman-core/lib/middleman-core/step_definitions/server_steps.rb:77
```

Let me know if y'all need anything, I'm happy to work on getting it fixed -- I just don't know the internals well enough to know where to start.