用于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-02-24 10:16:36

    Java工具类之Apache的Commons Lang和BeanUtils

    Apache Commons包估计是Java中使用最广发的工具包了,很多框架都依赖于这组工具包中的一部分,它提供了我们常用的一些编程需要,但是JDK没能提供的机能,最大化的减少重复代码的编写。

  • 2018-03-04 10:15:33

    HTTP代理协议 HTTP/1.1的CONNECT方法

    我们平时使用HTTP协议无非就是GET、POST这些方法,但是HTTP的内容远不止那些。今天就来说说HTTP代理使用的CONNECT。这个不是在网页开发上用的,如果没兴趣就跳过吧。

  • 2018-03-05 11:30:04

    iOS wkwebkit 播放HTML5 视频 全屏问题解决

    使用html5 的video标签播放视频的时候,限制视频的尺寸,在android上是没有问题的,但是在ios上发现,视频没有开始播放的时候还是好的,但是一旦播放开是,就会全屏,非常奇怪。