-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.js
38 lines (37 loc) · 907 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* rehype plugin to minify JSON `<script>`s.
*
* ## What is this?
*
* This package is a plugin that can minify the contents of JSON `<script>`s:
* `<script>` elements with (currently) a type of `application/ld+json`.
*
* ## When should I use this?
*
* You can use this plugin when you want to improve the size of HTML documents.
*
* ## API
*
* ### `unified().use(rehypeMinifyJsonScript)`
*
* Minify JSON `<script>`s.
*
* ###### Returns
*
* Transform ([`Transformer`](https://github.com/unifiedjs/unified#transformer)).
*
* @example
* {}
* <script type="application/ld+json">
* {
* "@context": {
* "name": "http://xmlns.com/foaf/0.1/name",
* "@id": "http://me.example.com",
* "@type": "Person",
* "name": "John Smith",
* "homepage": "http://www.example.com/"
* }
* }
* </script>
*/
export {default} from './lib/index.js'