Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xadillax/true-html-escape

True module to escape and unescape html, including some unicode unescaping like `〹` that other escaping modules don't include.
https://github.com/xadillax/true-html-escape

Last synced: 5 days ago
JSON representation

True module to escape and unescape html, including some unicode unescaping like `〹` that other escaping modules don't include.

Awesome Lists containing this project

README

        

True Html Escape
================

True module to escape and unescape html, including some unicode unescaping like `〹` that other escaping modules don't include.

> Thanks to the base module [node-escapist](https://github.com/vpukhanov/node-escapist).

Installation
----------------

From npm:

```sh
$ npm install true-html-escape
```

From repo:

```sh
git clone https://github.com/XadillaX/true-html-escape.git
```

By [ZIP](https://github.com/XadillaX/true-html-escape/archive/master.zip).

Usage
----------------

```javascript
var escaper = require("true-html-escape");

escaper.escape("¤¥€"); ///<= ¤¥€
escaper.unescape("<span>王尼玛</span>"); ///<= 王尼玛
escaper.unescape("フランドール"); ///<= フランドール
escaper.unescape("(╭ ̄3 ̄)╭♡") ///<= (╭ ̄3 ̄)╭♡
```

> 所以说这货为了反转义一些非常恶心的 Unicode 转义编码,而 [npm](https://www.npmjs.org/search?q=escape%20html) 貌似找不到。

Contribute
----------------

You're welcome to improve this module.

Please contact me or just make pull request.

Thanks.