示例#1
0
 stream.replace = function (s, fn) {
     return stream.select(s, function (node) {
         if (typeof fn === 'function') {
             node.replace(function (html) { return fn(html, node); });
         }
         else node.replace(fn);
     });
 };
示例#2
0
 stream.remove = function (s, fn) {
     return stream.select(s, function (node) {
         node.remove();
         if (typeof fn === 'function') fn(node);
     });
 };