12
12
13
13
## Contents
14
14
15
- * [ What is this?] ( #what-is-this )
16
- * [ When should I use this?] ( #when-should-i-use-this )
17
- * [ Install] ( #install )
18
- * [ Use] ( #use )
19
- * [ API] ( #api )
20
- * [ ` unified().use(rehypeFormat[, options]) ` ] ( #unifieduserehypeformat-options )
21
- * [ ` Options ` ] ( #options )
22
- * [ Examples] ( #examples )
23
- * [ Example: markdown input (remark)] ( #example-markdown-input-remark )
24
- * [ Example: tabs and blank lines (` indent ` , ` blanks ` )] ( #example-tabs-and-blank-lines-indent-blanks )
25
- * [ Types] ( #types )
26
- * [ Compatibility] ( #compatibility )
27
- * [ Security] ( #security )
28
- * [ Related] ( #related )
29
- * [ Contribute] ( #contribute )
30
- * [ License] ( #license )
15
+ * [ What is this?] ( #what-is-this )
16
+ * [ When should I use this?] ( #when-should-i-use-this )
17
+ * [ Install] ( #install )
18
+ * [ Use] ( #use )
19
+ * [ API] ( #api )
20
+ * [ ` unified().use(rehypeFormat[, options]) ` ] ( #unifieduserehypeformat-options )
21
+ * [ ` Options ` ] ( #options )
22
+ * [ Examples] ( #examples )
23
+ * [ Example: markdown input (remark)] ( #example-markdown-input-remark )
24
+ * [ Example: tabs and blank lines (` indent ` , ` blanks ` )] ( #example-tabs-and-blank-lines-indent-blanks )
25
+ * [ Types] ( #types )
26
+ * [ Compatibility] ( #compatibility )
27
+ * [ Security] ( #security )
28
+ * [ Related] ( #related )
29
+ * [ Contribute] ( #contribute )
30
+ * [ License] ( #license )
31
31
32
32
## What is this?
33
33
34
34
This package is a [ unified] [ ] ([ rehype] [ ] ) plugin to format whitespace in HTML.
35
35
In short, it works as follows:
36
36
37
- * collapse all existing white space to either a line ending or a single space
38
- * remove those spaces and line endings if they do not contribute to the
39
- document
40
- * inject needed line endings
41
- * indent previously collapsed line endings properly
37
+ * collapse all existing white space to either a line ending or a single space
38
+ * remove those spaces and line endings if they do not contribute to the
39
+ document
40
+ * inject needed line endings
41
+ * indent previously collapsed line endings properly
42
42
43
43
** unified** is a project that transforms content with abstract syntax trees
44
44
(ASTs).
@@ -141,8 +141,8 @@ Format whitespace in HTML.
141
141
142
142
###### Parameters
143
143
144
- * ` options ` ([ ` Options ` ] [ api-options ] , optional)
145
- — configuration
144
+ * ` options ` ([ ` Options ` ] [ api-options ] , optional)
145
+ — configuration
146
146
147
147
###### Returns
148
148
@@ -154,16 +154,16 @@ Configuration (TypeScript type).
154
154
155
155
###### Fields
156
156
157
- * ` blanks ` (` Array<string> ` , default: ` [] ` )
158
- — list of tag names to join with a blank line (default: ` [] ` ); these tags,
159
- when next to each other, are joined by a blank line (` \n\n ` ); for example,
160
- when ` ['head', 'body'] ` is given, a blank line is added between these two
161
- * ` indent ` (` number ` , ` string ` , default: ` 2 ` )
162
- — indentation per level (default: ` 2 ` ); when number, uses that amount of
163
- spaces; when ` string ` , uses that per indentation level
164
- * ` indentInitial ` (` boolean ` , default: ` true ` )
165
- — whether to indent the first level (default: ` true ` ); this is usually the
166
- ` <html> ` , thus not indenting ` head ` and ` body `
157
+ * ` blanks ` (` Array<string> ` , default: ` [] ` )
158
+ — list of tag names to join with a blank line (default: ` [] ` ); these tags,
159
+ when next to each other, are joined by a blank line (` \n\n ` ); for example,
160
+ when ` ['head', 'body'] ` is given, a blank line is added between these two
161
+ * ` indent ` (` number ` , ` string ` , default: ` 2 ` )
162
+ — indentation per level (default: ` 2 ` ); when number, uses that amount of
163
+ spaces; when ` string ` , uses that per indentation level
164
+ * ` indentInitial ` (` boolean ` , default: ` true ` )
165
+ — whether to indent the first level (default: ` true ` ); this is usually the
166
+ ` <html> ` , thus not indenting ` head ` and ` body `
167
167
168
168
## Examples
169
169
@@ -276,16 +276,16 @@ When in doubt, use [`rehype-sanitize`][rehype-sanitize].
276
276
277
277
## Related
278
278
279
- * [ ` rehype-minify ` ] ( https://github.com/rehypejs/rehype-minify )
280
- — minify HTML
281
- * [ ` rehype-document ` ] ( https://github.com/rehypejs/rehype-document )
282
- — wrap a fragment in a document
283
- * [ ` rehype-sanitize ` ] ( https://github.com/rehypejs/rehype-sanitize )
284
- — sanitize HTML
285
- * [ ` rehype-toc ` ] ( https://github.com/JS-DevTools/rehype-toc )
286
- — add a table of contents (TOC)
287
- * [ ` rehype-section ` ] ( https://github.com/agentofuser/rehype-section )
288
- — wrap headings and their contents in sections
279
+ * [ ` rehype-minify ` ] ( https://github.com/rehypejs/rehype-minify )
280
+ — minify HTML
281
+ * [ ` rehype-document ` ] ( https://github.com/rehypejs/rehype-document )
282
+ — wrap a fragment in a document
283
+ * [ ` rehype-sanitize ` ] ( https://github.com/rehypejs/rehype-sanitize )
284
+ — sanitize HTML
285
+ * [ ` rehype-toc ` ] ( https://github.com/JS-DevTools/rehype-toc )
286
+ — add a table of contents (TOC)
287
+ * [ ` rehype-section ` ] ( https://github.com/agentofuser/rehype-section )
288
+ — wrap headings and their contents in sections
289
289
290
290
## Contribute
291
291
0 commit comments