New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

template-remover

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

template-remover

Remove the template markup from html files

  • 0.1.9
  • PyPI
  • Socket score

Maintainers
1

Template Remover

.. image:: https://badge.fury.io/py/template-remover.png :target: http://badge.fury.io/py/template-remover

.. image:: https://travis-ci.org/deezer/template-remover.png?branch=master :target: https://travis-ci.org/deezer/template-remover

.. image:: https://coveralls.io/repos/deezer/template-remover/badge.png?branch=master :target: https://coveralls.io/r/deezer/template-remover?branch=master

Template remover is a tool to remove the PHP and Jinja markup from HTML files.

Motivation

Many tools, like html tidy, are designed to parse and analyze html files, however they do not play well when there is language markup. This projects aims to be a simple way of getting rid of those markups.

Limitations

template_remover is based on regular expressions. This means that there are some edge cases that cannot be captured with this method. Although we believe those cases are too contrived, and probably should be avoided as many development tools will fail as well.

One example that won't work is the following:::

" ?>

The reason it does not work is because when the method sees the first '?>' (the one inside the string), it thinks it's a closing tag.

Example use

Below are example of how template_remover.py is used::

$ remove_template.py filename.html $ remove_template.py filename.html | tidy -qe

Installation

You can install, upgrade or uninstall template-remover with these commands::

$ pip install template-remover $ pip install --upgrade template-remover $ pip uninstall template-remover

Python Versions

Python 2.7 is officially supported, 3.2, 3.3 and 3.4 should also work.

Development

Help for this project is more than welcomed, so feel free to create an issue or to send a pull request via http://github.com/deezer/template-remover.

Tests are run using nose, either with::

$ python -R setup.py nosetests $ nosetests

Use the tool git-lint <https://github.com/sk-/git-lint>_ before any commit, so errors and style problems are caught early.

TODOS and Possible Features

  • Support more template engines and languages (Smarty, ASP, JSP, etc).

Changelog

v0.1 (2014-05-07)

  • Initial commit.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc