There a was a bug in the highlighting of attributes’ values. The problem was that any string got highlighted, even if it wasn’t preceded by an equal sign. That’s fixed now.
Also I’ve added the PHP’s opening and closing tags.
/*
===============================================================================
Chili Recipe for the XHTML language
...............................................................................
Version: 1.5d - 2007/02 - http://noteslog.com/chili/
-------------------------------------------------------------------------------
Copyright (c) 2006 Andrea Ercolino
http://www.opensource.org/licenses/mit-license.php
===============================================================================
*/
{
steps: {
mlcom : { exp: /\<!--(?:.|\n)*?--\>/ }
, tag : { exp: /(?:\<\!?[\w:]+)|(?:\>)|(?:\<\/[\w:]+\>)|(?:\/\>)/ }
, php : { exp: /(?:\<\?php\s)|(?:\<\?)|(?:\?\>)/ }
, aname : { exp: /\s+?[\w-]+:?\w+(?=\s*=)/ }
, avalue: {
exp: /(=\s*)(([\"\'])(?:(?:[^\3\\]*?(?:\3\3|\\.))*?[^\3\\]*?)\3)/
, replacement: '$1<span class="$0">$2</span>' }
, entity: { exp: /&[\w#]+?;/ }
}
}
Here is the last version of the XHTML recipe, which now supports name spaces (thanks to Manfred for pointing out the issue)
/*
===============================================================================
Chili Recipe for the XHTML language
...............................................................................
Version: 1.5c - 2007/02 - http://noteslog.com/chili/
-------------------------------------------------------------------------------
Copyright (c) 2006 Andrea Ercolino
http://www.opensource.org/licenses/mit-license.php
===============================================================================
*/
{
steps: {
mlcom : { exp: /\<!--(?:.|\n)*?--\>/ }
, aname : { exp: /\s+?[\w-]+:?\w+(?=\s*=)/ }
, tag : { exp: /(?:\<\!?[\w:]+)|(?:\>)|(?:\<\/[\w:]+\>)|(?:\/\>)/ }
, avalue: { exp: /([\"\'])(?:(?:[^\1\\]*?(?:\1\1|\\.))*[^\1\\]*?)\1/ }
, entity: { exp: /&[\w#]+?;/ }
}
}
Enzymes can be complex PHP scripts, but basic enzymes are also very useful. This one is a oneliner, and it allows to transclude a web page inside a post. Really all the magic is played by an IFRAME element, but Enzymes makes it easy to use the method over and over, without any need to remember: “how did I do it?”
this is got by the statement {[.page(.google)]}
this is got by the statement {[.page(.yahoo)]}
Here is the code for the page field:
echo "<iframe width='450' height='200' src='" . $this->substrate . "'></iframe>";
Here is the code for the google and yahoo fields respectively:
http://www.google.com/
http://www.yahoo.com/
Easy, isn’t it?