Datasette SQL functions for very simple HTML operations
Install this plugin in the same environment as Datasette.
datasette install datasette-simple-html
This plugin provides the following SQL functions:
Returns the text with any <...>
tags removed.
Escapes any HTML special characters in the text, e.g. >
becomes >
. Uses html.escape(text, quote=True) from the Python standard library.
Unescapes any HTML special characters, so >
becomes >
. Also handles numeric entities, so '
becomes '
. Uses html.unescape(text) from the Python standard library.
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-simple-html
python3 -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest