bugfix for add_script: only add in case of HTML output