Closed DanielaValero closed 8 years ago
The issue was that the spaces between the {% body %} tag was telling the parser that it was a code block. Removing the spaces fixed the issue.
Related issue closed also: https://github.com/assemble/assemble/issues/876
glad we got this figured out!
you could try using strip-indent in a helper. I've done that in the past but can't remember if there were any drawbacks.
var stripIndent = require('strip-indent');
app.helper('stripIndent', function(options) {
return stripIndent(options.fn(this));
});
You might need to play with the context passed to options.fn()
, but you should be able to use it like this:
{{#markdown}}
{{#stripIndent}}
{% body %}
{{/stripIndent}}
{{/markdown}}
You could also create another "intermediary" layout that only exists for stripping indentation using this helper. just thinking out loud...
description
I am running assemble with gulp, and in my settings, no matter what I write in the first line, it will always be interpreted as if I was writing code.
Expected behaviour
Renders the first line of the content of the markdown as a headline, or whatever syntax was used in there.
Actual behaviour
It renders the first line of the .md file as a code block
version
0.2.1
Markdown file
Layout