Edgewall Software

Changes between Version 6 and Version 7 of MarkupStream


Ignore:
Timestamp:
Aug 29, 2006, 12:21:27 PM (18 years ago)
Author:
cmlenz
Comment:

Replace right-shift with pipes. Thanks to cboos for noticing the mistake

Legend:

Unmodified
Added
Removed
Modified
  • MarkupStream

    v6 v7  
    6767}}}
    6868
    69 Finally, filters can also be applied using the ''right shift'' operator (`>>`):
     69Finally, filters can also be applied using the ''bitwise or'' operator (`|`), which allows a syntax similar to pipes on Unix shells:
    7070
    7171{{{
    7272#!python
    73 stream = stream >> noop
     73stream = stream | noop
    7474}}}
    7575
    7676 ''Note: this is only available in the current development version (0.3)''
    77 
    78  '''Q: will it be `>>`, or `|` as in r254?'''
    79  ''(off-topic: Akismet once again rejected that change, had to log in... sigh)''
    8077
    8178One example of a filter included with Markup is the `HTMLSanitizer` in `markup.filters`. It processes a stream of HTML markup, and strips out any potentially dangerous constructs, such as Javascript event handlers. `HTMLSanitizer` is not a function, but rather a class that implements `__call__`, which means instances of the class are callable.
     
    9390{{{
    9491#!python
    95 stream = stream >> noop >> HTMLSanitizer()
     92stream = stream | noop | HTMLSanitizer()
    9693}}}
    9794
     
    143140}}}
    144141
    145 The right-shift operator (added in 0.3) allows a nicer syntax:
     142The pipe operator (added in 0.3) allows a nicer syntax:
    146143
    147144{{{
    148 >>> print stream >> HTMLSanitizer() >> TextSerializer()
     145>>> print stream | HTMLSanitizer() | TextSerializer()
    149146Some text and a link.
    150147}}}