PHP Markdown 1.0.1l & Extra 1.2
John MacFarlane
jgm at berkeley.edu
Mon May 12 17:50:12 EDT 2008
The development version of pandoc has for some time
implemented "fenced" code blocks. See
http://code.google.com/p/pandoc/source/browse/trunk/README#717
for documentation. Two small differences with your syntax:
1. pandoc allows the block to be ended by a line of tildes
of the same length as *or longer than* the start line.
Reason: It's easy to produce a longer line by just eyeballing
it, whereas to produce a line of exactly the same length,
you generally need to cut and paste. I'm following the
general markdown philosophy of allowing slop when it's harmless.
2. pandoc allows { .haskell .number-lines } (or whatever) after
the *top* line of tildes. If pandoc is compiled with highlighting
support, it uses this information to highlight the block; otherwise,
it just includes it as a class.
Thanks for pointing out the complexity involving leading blank lines
in code blocks; I'll make a note to fix that.
If anyone wants to try pandoc with the delimited ("fenced") code blocks and
built-in syntax highlighting, see
http://groups.google.com/group/pandoc-discuss/browse_thread/thread/b59714fcfc7a7e69
for instructions.
John
+++ Michel Fortin [May 11 08 08:31 ]:
> Time for an update to PHP Markdown and PHP Markdown Extra.
>
> <http://michelf.com/project/php-markdown/>
>
> This new version of PHP Markdown Extra adds support for "fenced" code
> blocks (which I was previously calling "flat"). Fenced code blocks
> overcome many limitations of Markdown's indented code blocks: they can
> can be put immediately following a list item, can start and end with
> blank lines, and can be put one after the other as two consecutive code
> blocks. Also, if you're using an editor which cannot indent
> automatically a selected block of text, such as a text box in your web
> browser, it's easier to paste code in.
>
> <http://michelf.com/projects/php-markdown/extra/#fenced-code-blocks>
>
>
> 1.0.1l (11 May 2008):
>
> * Now removing the UTF-8 BOM at the start of a document, if present.
>
> * Now accepting capitalized URI schemes (such as HTTP:) in automatic
> links, such as `<HTTP://EXAMPLE.COM/>`.
>
> * Fixed a problem where `<hr at example.com>` was seen as a horizontal
> rule instead of an automatic link.
>
> * Fixed an issue where some characters in Markdown-generated HTML
> attributes weren't properly escaped with entities.
>
> * Fix for code blocks as first element of a list item. Previously,
> this didn't create any code block for item 2:
>
> * Item 1 (regular paragraph)
>
> * Item 2 (code block)
>
> * A code block starting on the second line of a document wasn't seen
> as a code block. This has been fixed.
>
> * Added programatically-settable parser properties `predef_urls` and
> `predef_titles` for predefined URLs and titles for reference-style
> links. To use this, your PHP code must call the parser this way:
>
> $parser = new Markdwon_Parser;
> $parser->predef_urls = array('linkref' => 'http://example.com');
> $html = $parser->transform($text);
>
> You can then use the URL as a normal link reference:
>
> [my link][linkref]
> [my link][linkRef]
>
> Reference names in the parser properties *must* be lowercase.
> Reference names in the Markdown source may have any case.
>
> * Added `setup` and `teardown` methods which can be used by subclassers
> as hook points to arrange the state of some parser variables before and
> after parsing.
>
>
> Extra 1.2 (11 May 2008):
>
> * Added fenced code block syntax which don't require indentation
> and can start and end with blank lines. A fenced code block
> starts with a line of consecutive tilde (~) and ends on the
> next line with the same number of consecutive tilde. Here's an
> example:
>
> ~~~~~~~~~~~~
> Hello World!
> ~~~~~~~~~~~~
>
> * Rewrote parts of the HTML block parser to better accomodate
> fenced code blocks.
>
> * Footnotes may now be referenced from within another footnote.
>
> * Added programatically-settable parser property `predef_attr` for
> predefined attribute definitions.
>
> * Fixed an issue where an indented code block preceded by a blank
> line containing some other whitespace would confuse the HTML
> block parser into creating an HTML block when it should have
> been code.
>
>
> Michel Fortin
> michel.fortin at michelf.com
> http://michelf.com/
>
>
> _______________________________________________
> Markdown-Discuss mailing list
> Markdown-Discuss at six.pairlist.net
> http://six.pairlist.net/mailman/listinfo/markdown-discuss
>
More information about the Markdown-Discuss
mailing list