7 – views template strips SCRIPT markup

I use custom display output views template to add markup to view. Somehow it seems that whatever the template output is filtered through, it strips script tags. Anybody know what function and where does the stripping occur? Btw adding script tags works when using views field templates without problem.
Thank you