[prev in list] [next in list] [prev in thread] [next in thread] 

List:       markdown-discuss
Subject:    Re: Tab size of code blocks
From:       Igor Zhbanov <izh1979 () gmail ! com>
Date:       2016-10-02 11:31:05
Message-ID: CAEUiM9NDmrJgatgNfTNCJL1BZ-oS8fJ-Eshn8snYR2qegH9Xpw () mail ! gmail ! com
[Download RAW message or body]

Hi Michel,

2016-10-02 14:25 GMT+03:00 Michel Fortin <michel.fortin@michelf.ca>:
> Le 2 oct. 2016 à 6:24, Igor Zhbanov <izh1979@gmail.com> a écrit :
> > 
> > Hi.
> > 
> > Markdown allows to include code blocks by using
> > ```c
> > printf("Hello World ¥n");
> > ```
> 
> Technically this syntax is an extension that is not part of the reference Markdown \
> spec. But it's true that many (most?) Markdown parsers support it today.

Yes. And I'm talking about extending the markdown syntax. ;-) If it's possible.

> > But it doesn't allow to specify the tab size (number of spaces). As I see,
> > Markdown states that the tab size is 4: "To produce a code block
> > in Markdown, simply indent every line of the block by at least 4 spaces
> > or 1 tab."
> 
> You will have to check if the parser you are using has a setting like this. For \
> instance, there is one called [`tab_width`][1] in PHP Markdown. But note that its \
> effect will apply to everything in the document, not just code blocks, so be \
> cautious about using tabs to indent lists and other things if you change this \
> settings. Most likely, Gitlab uses another parser, so it it might behave \
> differently if it has such a setting.

Gitlab uses redcarpet ruby gem to parse markdown. And it has 4 spaces
hardcoded in expand_tabs function. I've written them letter too.

I think ideally we should have both global and per-block settings.
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
https://pairlist6.pair.net/mailman/listinfo/markdown-discuss


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic