mirror of
https://github.com/AmanoTeam/htmlunescape.git
synced 2025-12-14 08:37:46 -03:00
Port of Python's html.escape and html.unescape to Nim
| .github/workflows | ||
| external | ||
| src | ||
| tests | ||
| .gitignore | ||
| htmlunescape.nimble | ||
| README.md | ||
HTML (Un)escape is a port of Python's html.escape and html.unescape to Nim.
Installation
Install using nimble:
nimble install --accept 'htmlunescape'
Usage:
Escaping sequences:
import htmlunescape
assert escape(s = "'<script>\"&foo;\"</script>'") == "'<script>"&foo;"</script>'"
assert escape(s = "'<script>\"&foo;\"</script>'", quote = false) == "'<script>\"&foo;\"</script>'"
Unescaping sequences:
import htmlunescape
assert unescape(s = """"") == "\"\"\""
assert unescape(s = "&&&") == "&&&"
Contributing
If you have discovered a bug in this library and know how to fix it, fork this repository and open a Pull Request.