Skip to content

Commit 56cdd50

Browse files
Test self-closing options
1 parent f894a9b commit 56cdd50

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div>self closing?</div>

docs-src/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const src = './docs-src/pages/';
1313
const dist = './docs/';
1414
const md = './docs-src/md';
1515

16-
const options = {};
16+
const options = {
17+
recognizeSelfClosing: true
18+
};
1719

1820
readdirSync(src).forEach(file => {
1921
const html = readFileSync(path.resolve(`${src}${file}`), 'utf-8');
@@ -27,6 +29,10 @@ readdirSync(src).forEach(file => {
2729
locals: {
2830
title: 'PostHTML Components'
2931
}
32+
},
33+
parserOptions: {
34+
// Don't work
35+
recognizeSelfClosing: false
3036
}
3137
}),
3238

docs-src/pages/test.html

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
<div class="col-lg-8">
44
<h1 class="display-1 fw-bold mb-4">Playground</h1>
55

6+
<h2>Self closing tag</h2>
7+
<x-test.self-closing />
8+
<p>Works?</p>
9+
610
<x-test.div1 aware:myprop="My CUSTOM prop in div1">
711
<x-test.div2>
812
<x-test.div3>

docs/test.html

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
<div class="row">
4848
<div class="col-lg-8">
4949
<h1 class="display-1 fw-bold mb-4">Playground</h1>
50+
<h2>Self closing tag</h2>
51+
<div>self closing?</div>
52+
<p>Works?</p>
5053
<div>
5154
div1: My CUSTOM prop in div1
5255
<div>

0 commit comments

Comments
 (0)