Skip to content

Commit 659daa1

Browse files
authored
Merge pull request #251 from anikethsaha/feat-comment-formatting
feat: added newline formatting for comments
2 parents 11346cd + 95e26c1 commit 659daa1

File tree

3 files changed

+355
-129
lines changed

3 files changed

+355
-129
lines changed

readme.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,41 @@ Default:
9595
Default: false
9696
Description: *Add a `lang` attribute in elements, eg: `{ lang: 'fr' }`*
9797

98+
- **commentFormat**
99+
Type: `Boolean`
100+
Default: true
101+
Description: Formats the comments. It does the following
102+
- If there are multi line comments then there would be
103+
leading and trailing newline like this
104+
105+
```html
106+
// Input
107+
108+
<!-- multiline
109+
comments-->
110+
111+
// Output
112+
113+
<!--
114+
multiline
115+
comments
116+
-->
117+
```
118+
- If there is a single line comment, it would make it to a single line with the comment starting and ending
119+
notation in same line
120+
121+
Input
122+
```
123+
<!--
124+
singleline comments
125+
-->
126+
```
127+
128+
Output
129+
130+
`<!-- singleline comments -->`
131+
132+
98133
### `mini`
99134
Type: `Object`
100135
Default:

0 commit comments

Comments
 (0)