We are using a mix of partials, custom helpers, and variables to produce single-source documentation. It looks something like this:
<% if productA? %> <%= partial "includes/snippets/snippet-prodA.md" %> <% end %> <% if productB? %> <%= partial "includes/snippets/snippet-prodB.md" %> <% end %>
It outputs the expected content: according to the variables we set in the config.rb file, the correct markdown content is included and converted to HTML.
The issue we are having is that the content in the partial is wrapped in a paragraph tag. For example, assuming that the markdown file includes the following content:
# This is my heading This is some text.
This will be output in HTML as follows:
<p><h1 id='this-is-my-heading'>This is my heading</h1> <p>This is some text.</p> </p>
This extra paragraph tag is creating havoc on our formatting.
The issue occurs only if the partial is included in a custom helper. My helper function looks like this:
helpers do def productA? config[:product_environment] == "productA" end end
Has anyone ever encountered this? Any ideas on how to solve this?
Note: We are using the Slate framework, built on Middleman.