Skip to content

Commit e3fecb8

Browse files
committed
fix: @putout/processor-html: branch: trim
1 parent af29261 commit e3fecb8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/processor-html/lib/html.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import htmlToJsx from 'node-html-to-jsx';
22

33
const DIV_OPEN = 5;
4-
const DIV_CLOSE = -7;
4+
const DIV_CLOSE = -6;
55

66
export const files = ['*.html'];
77

88
export const branch = (rawSource) => {
99
const content = htmlToJsx(rawSource);
10-
const source = content.slice(DIV_OPEN, DIV_CLOSE);
10+
const source = content
11+
.trim()
12+
.slice(DIV_OPEN, DIV_CLOSE);
1113

1214
return [{
1315
source,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22
<ul data-name="menu" class="menu menu-hidden" "=" ">
3-
</ul>
3+
</ul>

0 commit comments

Comments
 (0)