HTML (Un)escape is a port of Python's html.escape and html.unescape to Nim.
Install using nimble:
nimble install --accept 'htmlunescape'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 = "&&&") == "&&&"If you have discovered a bug in this library and know how to fix it, fork this repository and open a Pull Request.