Markdown and code block indentation

338 views
Skip to first unread message

Felix

unread,
Feb 28, 2010, 11:43:58 AM2/28/10
to nanoc list
Hi all,

I am not sure where the problem lays exactly yet but when I use markdown
to describe a code block like so:

Normal paragraph

this is code
so is this
and this too

...the first line of code is fine but then all other lines in the code
block are indented. According to the markdown references the first 4
spaces (or one tab) should be removed from each line.

When I run the file directly through Maruku it formats it correctly,
when it is done using Nanoc (3.1.0) it adds the extra indentation (or
fails to remove it) from all the other lines.

Anyone else have similar behaviour?

-felix

mgutz

unread,
Feb 28, 2010, 1:11:50 PM2/28/10
to nanoc
I had this happen when using HAML for layout and Markdown for the
view. If you are doing the same use find_and_preserve(yield) in your
layout.

Denis Defreyne

unread,
Feb 28, 2010, 1:17:31 PM2/28/10
to na...@googlegroups.com
On 28 Feb 2010, at 17:43, Felix wrote:

> ...the first line of code is fine but then all other lines in the code
> block are indented. According to the markdown references the first 4
> spaces (or one tab) should be removed from each line.

Hi,

This is odd. Can you send me (in private) the source for your site so I can take a look at what’s going on? If you want, you can build a minimized test case where this error occurs.

Denis

--
Denis Defreyne
denis.d...@stoneship.org

Felix

unread,
Mar 1, 2010, 2:45:41 AM3/1/10
to na...@googlegroups.com
I have that very situation, HAML layout and markdown content. This fixed
it and it makes a little sense too. HAML is whitespace sensitive and no
doubt the yielded content was being placed at the same indent hierarchy
in the HAML file.

Thanks for that.

> --
> You received this message because you are subscribed to the nanoc discusssion group.
>
> To post to this group, send email to na...@googlegroups.com
> To unsubscribe from this group, send email to nanoc+un...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/nanoc

--
email: felix(at)seconddrawer.com.au
web: http://seconddrawer.com.au/
support: http://support.seconddrawer.com.au/
gpg: E6FC 5BC6 268D B874 E546 8F6F A2BB 220B D5F6 92E3

Please don't send me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

Alexander Mankuta

unread,
Mar 1, 2010, 5:08:37 AM3/1/10
to na...@googlegroups.com
Felix, :ugly output in haml fixes that too. Also it's a bit faster that default.
Reply all
Reply to author
Forward
0 new messages