I get a lot of requests for Github-style fenced code blocks in PHP Markdown Extra. While I despite the syntax -- it also happens to be a valid code span! -- I wonder whether I should relent on this. It seems to be bothering a lot of people (even those who know about the tilde-based fenced code block syntax). In Github-Flavored Markdown, a code block works like this: ```php some php code ``` Replace those backticks with tildes and you get a valid fenced code block in PHP Markdown Extra: ~~~php some php code ~~~ Of course, now Github also supports tilde for fenced code blocks. But their documentation only mention the backtick-based syntax. <https://help.github.com/articles/github-flavored-markdown> If take a look at Babelmark 2, it seems that most implementations supporting one also support the other. <http://johnmacfarlane.net/babelmark2/?normalize=1&text=```php%0Asome+php+code%0A```%0A> <http://johnmacfarlane.net/babelmark2/?normalize=1&text=~~~php%0Asome+php+code%0A~~~%0A> I wondered if some of you have any opinion to share on this. -- Michel Fortin michel.fortin at michelf.ca http://michelf.ca
AFAIK backticks are commonly used and known. It'd be good to support it in PHP Markdown Extra until a consensus spec rises. 2013-09-27 14:48 tarihinde, Michel Fortin yazd?:> I get a lot of requests for Github-style fenced code blocks in PHP Markdown Extra. While I despite the syntax -- it also happens to be a valid code span! -- I wonder whether I should relent on this. It seems to be bothering a lot of people (even those who know about the tilde-based fenced code block syntax). > > In Github-Flavored Markdown, a code block works like this: > > ```php > some php code > ``` > > Replace those backticks with tildes and you get a valid fenced code block in PHP Markdown Extra: > > ~~~php > some php code > ~~~ > > Of course, now Github also supports tilde for fenced code blocks. But their documentation only mention the backtick-based syntax. > <https://help.github.com/articles/github-flavored-markdown> > > If take a look at Babelmark 2, it seems that most implementations supporting one also support the other. > <http://johnmacfarlane.net/babelmark2/?normalize=1&text=```php%0Asome+php+code%0A```%0A> > <http://johnmacfarlane.net/babelmark2/?normalize=1&text=~~~php%0Asome+php+code%0A~~~%0A> > > I wondered if some of you have any opinion to share on this. >
On 2013-09-27 07:48 -0400 Michel Fortin wrote:> > Of course, now Github also supports tilde for fenced code blocks. But > their documentation only mention the backtick-based syntax. > <https://help.github.com/articles/github-flavored-markdown> > > If take a look at Babelmark 2, it seems that most implementations > supporting one also support the other. > <http://johnmacfarlane.net/babelmark2/?normalize=1&text=```php%0Asome+php+code%0A```%0A> > <http://johnmacfarlane.net/babelmark2/?normalize=1&text=~~~php%0Asome+php+code%0A~~~%0A> > > I wondered if some of you have any opinion to share on this.kramdown doesn't explicitly support the Github-style fenced code blocks. There were also many requests to implement it but this will not happen in kramdown (at least for version 1.0). kramdown now has a separate parser based on the kramdown parser which has some GFM adaptions like this one. So +1 from me if you decide to not implement it. -- Thomas
I just used the tilde style today on GitHub, before reading this thread. Honestly, it's hard to remember what supports what; I would prefer for all implementations to support all three styles (back-tick, tilde, indented) in order to maximize portability and minimize surprise. (StackOverflow gets a lot of requested for fenced code blocks. Consensus on Meta SO is "yep, we need 'em, and probably with either delimiter" but no one is actually implementing them on SO yet, as I recall.)> On Sep 27, 2013, at 4:48 AM, Michel Fortin <michel.fortin at michelf.ca> wrote: > > I get a lot of requests for Github-style fenced code blocks in PHP Markdown Extra. While I despite the syntax -- it also happens to be a valid code span! -- I wonder whether I should relent on this. It seems to be bothering a lot of people (even those who know about the tilde-based fenced code block syntax). > > In Github-Flavored Markdown, a code block works like this: > > ```php > some php code > ``` > > Replace those backticks with tildes and you get a valid fenced code block in PHP Markdown Extra: > > ~~~php > some php code > ~~~ > > Of course, now Github also supports tilde for fenced code blocks. But their documentation only mention the backtick-based syntax. > <https://help.github.com/articles/github-flavored-markdown> > > If take a look at Babelmark 2, it seems that most implementations supporting one also support the other. > <http://johnmacfarlane.net/babelmark2/?normalize=1&text=```php%0Asome+php+code%0A```%0A> > <http://johnmacfarlane.net/babelmark2/?normalize=1&text=~~~php%0Asome+php+code%0A~~~%0A> > > I wondered if some of you have any opinion to share on this. > > -- > Michel Fortin > michel.fortin at michelf.ca > http://michelf.ca > > _______________________________________________ > Markdown-Discuss mailing list > Markdown-Discuss at six.pairlist.net > http://six.pairlist.net/mailman/listinfo/markdown-discuss
I "relented" and added support for GFM (```) fenced code blocks to MultiMarkdown. I prefer the original GFM syntax, precisely because it is also a valid code span. This means that a Markdown parser without knowledge of fenced code blocks will still do the right thing, except handle the specified language for syntax highlighting. Fletcher -- Fletcher T. Penney fletcher at fletcherpenney.net On Sep 27, 2013, at 7:48 AM, Michel Fortin <michel.fortin at michelf.ca> wrote:> I get a lot of requests for Github-style fenced code blocks in PHP Markdown Extra. While I despite the syntax -- it also happens to be a valid code span! -- I wonder whether I should relent on this. It seems to be bothering a lot of people (even those who know about the tilde-based fenced code block syntax). > > In Github-Flavored Markdown, a code block works like this: > > ```php > some php code > ``` > > Replace those backticks with tildes and you get a valid fenced code block in PHP Markdown Extra: > > ~~~php > some php code > ~~~ > > Of course, now Github also supports tilde for fenced code blocks. But their documentation only mention the backtick-based syntax. > <https://help.github.com/articles/github-flavored-markdown> > > If take a look at Babelmark 2, it seems that most implementations supporting one also support the other. > <http://johnmacfarlane.net/babelmark2/?normalize=1&text=```php%0Asome+php+code%0A```%0A> > <http://johnmacfarlane.net/babelmark2/?normalize=1&text=~~~php%0Asome+php+code%0A~~~%0A> > > I wondered if some of you have any opinion to share on this. > > -- > Michel Fortin > michel.fortin at michelf.ca > http://michelf.ca > > _______________________________________________ > Markdown-Discuss mailing list > Markdown-Discuss at six.pairlist.net > http://six.pairlist.net/mailman/listinfo/markdown-discuss-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4899 bytes Desc: not available Url : <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20130927/236c5871/attachment.bin>
* Michel Fortin <michel.fortin at michelf.ca> [2013-09-27 13:50]:> I despite the syntax -- it also happens to be a valid code span!I share that concern. OTOH I always found the tilde fences supremely ugly. The backtick fences aren?t objectionable to me in the same way. Thus I?ve never been happy with either; I am, if you can find it in yourself to forgive the heinous pun, on the fence? Meanwhile I have reluctantly gotten used to triple backtick fences on GitHub because as far as I knew they were the only way to get syntax highlighting in comments. And frankly, even now that I know that tilde fences are supported, I doubt I?ll use them (because ugly). I think out of these options, I?ll go with using backtick fences while pining for a *good* choice ? some option that qualifies for my enthusiasm rather than my least reluctance. And so I appreciate Markdown implementations supporting them even though I dislike them. Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>