【文件属性】:
文件名称:html-entities:最快HTML实体编码编码库
文件大小:122KB
文件格式:ZIP
更新时间:2021-05-14 01:26:12
html-entities ascii-characters printable-characters html-special-characters TypeScript
html-entities
最快HTML实体库。
附带TypeScript和Flow类型。
安装
$ npm install html-entities
用法
编码(文本,选项)
编码文本,以替换HTML特殊字符( <>&"' )以及其他字符范围,具体取决于mode选项的值。
import { encode } from 'html-entities' ;
encode ( '< > " \' & :copyright: ∆' ) ;
// -> '< > " ' & :copyright: ∆'
encode ( '< :copyright:' , { mode : 'nonAsciiPrintable' } ) ;
// -> '< ©'
encode ( '< :copyright:' , { mode : 'nonAsciiPrintable' , level : 'xml' } ) ;
// -
【文件预览】:
html-entities-master
----.eslintrc(2KB)
----benchmark()
--------old()
--------benchmark.ts(10KB)
----package.json(2KB)
----tools()
--------process-named-references.ts(2KB)
----.github()
--------FUNDING.yml(48B)
--------workflows()
----test()
--------index.test.ts(7KB)
----.prettierrc(545B)
----LICENSE(1KB)
----src()
--------surrogate-pairs.ts(701B)
--------numeric-unicode-map.ts(470B)
--------named-references.source.json(164KB)
--------index.ts(6KB)
--------named-references.ts(133KB)
----tsconfig.json(302B)
----.gitignore(45B)
----CHANGELOG.md(4KB)
----README.md(7KB)
----yarn.lock(97KB)