用于HTML的Escape方法 – escape-goat

2020-12-14 08:47:00

Escape a string for use in HTML or the inverse

Install

$ npm install escape-goat复制代码

Usage

const escapeGoat = require('escape-goat');

escapeGoat.escape('?? & ??');
//=> '?? & ??'

escapeGoat.unescape('?? & ??');
//=> '?? & ??'

escapeGoat.escape('Hello World');
//=> 'Hello World'复制代码

API

escapeGoat.escape(input)

Escapes the following characters in the giveninputstring:&<>”‘

escapeGoat.unescape(html)

Unescapes the following HTML entities in the giveninputstring:&amp;&lt;&gt;&quot;&#39;


  • 2018-09-09 02:31:48

    基于VCamera,仿微信录制短视频

    基于VCamera,Android仿微信录制短视频,如果喜欢请star,如果觉得有纰漏请提交issue,如果你有更好的点子可以提交pull request。

  • 2018-09-13 22:24:04

    QQ微信登录失败,报100044错

    我用的mob的maven集成方案,说实在的从一开始用maven集成方案就是一个坑啊。每次build都会重新加载所有maven包,后来通过gradle offline总算解决了。

  • 2018-09-26 15:14:23

    PHP JSON_ENCODE 不转义中文汉字的方法

    PHP 生成JSON的时候,必须将汉字不转义为 \u开头的UNICODE数据。 网上很多,但是其实都是错误的,正确的方法是在json_encode 中加入一个参数 JSON_UNESCAPED_UNICODE

  • 2018-09-27 10:04:11

    jquery ajax超时设置

    原来ajax可以设置超时时间,那么简单,ajax还有更多功能,虽然不怎么用它,有时候还挺好用。