From f2abf82157a4cf3bd5255d971f62900a806b0031 Mon Sep 17 00:00:00 2001 From: Michel Fortin Date: Sat, 5 Jan 2013 21:18:58 -0500 Subject: [PATCH] Updated readme to talk about attributes on fenced code blocks. --- PHP Markdown Extra Readme.text | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/PHP Markdown Extra Readme.text b/PHP Markdown Extra Readme.text index 6ef631f..8d1b006 100644 --- a/PHP Markdown Extra Readme.text +++ b/PHP Markdown Extra Readme.text @@ -214,13 +214,45 @@ Version History Current Extra: -* Headers can now have a class attribute. You can add a class using this - syntax: +* Headers can now have a class attribute. You can add a class inside the + extra attribute block which can optionally be put after a header: ### Header ### {#id .class1 .class2} Spaces between components in the brace is optional. +* Fenced code blocks can also have a class and an id attribute. If you only + need to apply a class (typically to indicate the language of a code + snippet), you can write it like this: + + ~~~ html + bold + ~~~ + + or like this: + + ~~~ .html + bold + ~~~ + + There is a new configuration option `MARKDOWN_CODE_CLASS_PREFIX` you can + use if you need to append a prefix to the class name. + + You might also opt to use an extra attribute block just like for headers: + + ~~~ {.html #id .codeclass} + bold + ~~~ + + Note that class names added this way are not affected by the + MARKDOWN_CODE_CLASS_PREFIX. + + A code block creates a `pre` HTML element containing a `code` element. + The `code` HTML element is the one that receives the attribute. If for + some reason you need attributes to be applied to the enclosing `pre` + element instead, you can set the MARKDOWN_ATTR_ON_PRE configuration + variable to true. + * Multiple reference to the same footnote are now allowed. * Fixed an issue where no_markup mode was ineffective.