Skip to content

Commit 12afb0c

Browse files
committed
fix: @putout/processor-html: className -> class
1 parent c1255fd commit 12afb0c

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

packages/processor-html/lib/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const branch = (rawSource) => {
1414
}];
1515
};
1616

17-
export const merge = (rawSource, [first]) => fromJS(first);
17+
export const merge = (rawSource, [first]) => fromJS(first).replaceAll('className', 'class');
1818

1919
const SUFFIX = ';\n';
2020

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<html>
2+
<body class="red">
3+
4+
</body>
5+
</html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<html>
2+
<body class="red">
3+
<button>hello</button>
4+
</body>
5+
</html>

packages/processor-html/test/html.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ test('putout: processor: html', async ({process}) => {
1515
}],
1616
]);
1717
});
18+
19+
test('putout: processor: html: class', async ({process}) => {
20+
await process('class', [
21+
['remove-button', {
22+
report: () => '',
23+
replace: () => ({
24+
'<button>__a</button>': '',
25+
}),
26+
}],
27+
]);
28+
});

0 commit comments

Comments
 (0)