substack/node-trumpet — pull request #32 by pragmadash (2014-03-11 05:42:02+00:00)
Title: Add test for usage of trumpet inside element writable stream

I am working on stream-based template rendering engine and I've found that some artifacts may appear with steps described below:
* Create trumpet instance (T1)
* Select by ID any HTML element using trumpet (T1) and create writable stream for it (W1)
* Subscribe on 'drain' event of created element writable stream (W1)
* When W1 'drain' event raises then create another trumpet (T2) instance inside event handler and create writable stream for another HTML element ID (W2) using this new instance of trumpet (T2)
* Pipe any content or file through T2 to W2 (file.pipe(T2).pipe(W2))
* And if we pipe to T1 any content with elements which ids were selected we have artifacts on output

Artifacts like character repeats or remove of character etc.
Here is unit test for found issue.
I need this for recursive template rendering, please help.