- From: Shane McCarron via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 24 Feb 2010 15:45:39 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/ReSpec.js In directory hutz:/tmp/cvs-serv14556 Modified Files: documentation.html Log Message: Added support for data-transform attribute. Fixed pre.example handling so it uses innerHTML instead of TextContent. Index: documentation.html =================================================================== RCS file: /sources/public/2009/dap/ReSpec.js/documentation.html,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- documentation.html 22 Feb 2010 23:22:09 -0000 1.34 +++ documentation.html 24 Feb 2010 15:45:37 -0000 1.35 @@ -586,7 +586,33 @@ </pre> </section> - + <section> + <h2>Transforming data</h2> + <p> + Another thing you might want to do is transform arbitrary content in + your document (for example, to ensure that content within an 'example' + block is escaped). You can do this via the <code>data-transform</code>. + Just like the <code>data-oninclude</code> attribute above, this allows + you to specify a whitespace separated list of method names. Each will be called + and passed two parameters: the <code>berjon.respec</code> object and the contents of + the element. + </p> + <p>Here is an example, using the same method as above:</p> + <pre class='example'> +function updateExample(doc, content) { + // perform transformations to make it render and prettier + return '<pre class="example">' + doc._esc(content) + '</pre>'; +} + </pre> + <p>And then the content:</p> + <pre class='example'> + <pre class='example' data-transform='updateExample'> + <html> + ... + </html> + </pre> + </pre> + </section> <section> <h2>WebIDL Support</h2> @@ -831,6 +857,9 @@ <li>2010-02-22 - added handling for data-include and data-oninclude attributes. (spm) </li> + <li>2010-02-24 - added support for data-transform attribute. Fixed + pre.example support to use innerHTML instead of TextContent. + </li> </ul> </section>
Received on Wednesday, 24 February 2010 15:45:41 UTC