htmlunescape

Port of Python's html.escape and html.unescape to Nim

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License LGPL-3.0
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Tags

Installation

nimble install htmlunescape
choosenim install htmlunescape
git clone https://github.com/AmanoTeam/htmlunescape

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
htmlunescape - - - - - - -

Source

Repository https://github.com/AmanoTeam/htmlunescape
Homepage https://github.com/AmanoTeam/htmlunescape
Registry Source nimble_official

README

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>'") == "&#x27;&lt;script&gt;&quot;&amp;foo;&quot;&lt;/script&gt;&#x27;"
assert escape(s = "'<script>\"&foo;\"</script>'", quote = false) == "'&lt;script&gt;\"&amp;foo;\"&lt;/script&gt;'"

Unescaping sequences:

import htmlunescape

assert unescape(s = "&quot;&quot;&quot;") == "\"\"\""
assert unescape(s = "&amp;&amp;&amp;") == "&&&"

Contributing

If you have discovered a bug in this library and know how to fix it, fork this repository and open a Pull Request.