Changes between Version 22 and Version 23 of GenshiFaq
- Timestamp:
- Sep 11, 2006, 6:49:52 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenshiFaq
v22 v23 98 98 Genshi provides a number of ways to do that: 99 99 * The `Markup` class in the [ApiDocs/GenshiCore genshi.core] module can be used to flag strings that should not be escaped. Strings wrapped in a `Markup` instance get copied to the output unchanged. 100 * The `XML` and `HTML` functions in the [ApiDocs/GenshiInput genshi.input] module parse XML and HTML strings, respectively, and produce a [ GenshiStreammarkup stream]. Note that this option can be rather expensive, as the text needs to be parsed just to be serialized again. Also, this method fails on bad markup that cannot be parsed by either [http://docs.python.org/lib/module-HTMLParser.html HTMLParser] or [http://docs.python.org/lib/module-xml.parsers.expat.html Expat].100 * The `XML` and `HTML` functions in the [ApiDocs/GenshiInput genshi.input] module parse XML and HTML strings, respectively, and produce a [wiki:Documentation/streams.html markup stream]. Note that this option can be rather expensive, as the text needs to be parsed just to be serialized again. Also, this method fails on bad markup that cannot be parsed by either [http://docs.python.org/lib/module-HTMLParser.html HTMLParser] or [http://docs.python.org/lib/module-xml.parsers.expat.html Expat]. 101 101 * If you are generating the snippets in question yourself, you may want to use the [ApiDocs/GenshiBuilder genshi.builder] to [wiki:Documentation/builder.html generate markup streams programmatically]. Just as the results of the `XML` and `HTML` functions discussed above, the stream produced using `genshi.builder` will not be escaped in the template output. 102 102