metalsmith / markdown

A metalsmith plugin to render markdown files to HTML.
MIT License
63 stars 65 forks source link

Markdown code blocks are badly rendered #26

Closed ThePeach closed 6 years ago

ThePeach commented 6 years ago

so apparently I'm having a problem with the code blocks in markdown, where all the whitespace preceding the first line is being trimmed off, or there is some more that is being appended on the subsequent lines, no idea which one of the two is the case.

to give you more context, if I write:

$ git remote rm origin
$ git remote add origin git://your/repository/git

(that is prepending 4 spaces before each line)

the output is:

$ git remote rm origin
       $ git remote add origin git://your/repository/git

the generated markup is the following:

<pre><code>$ git remote rm origin
       $ git remote add origin git://your/repository/git
       </code></pre>

:sob:

doesn't change anything if I use


to wrap the code in markdown
ThePeach commented 6 years ago

the problem was on my side, more specifically in the way a subtemplate inclusion tag was indented within the page template, (the {{{content}}} was too but that wasn't a problem apparently). this caused the mess in the output from handlebar!

Closing now.