Skip to content

Commit

Permalink
Test self-closing options
Browse files Browse the repository at this point in the history
  • Loading branch information
thewebartisan7 committed Mar 17, 2023
1 parent f894a9b commit 56cdd50
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs-src/components/test/self-closing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>self closing?</div>
8 changes: 7 additions & 1 deletion docs-src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const src = './docs-src/pages/';
const dist = './docs/';
const md = './docs-src/md';

const options = {};
const options = {
recognizeSelfClosing: true
};

readdirSync(src).forEach(file => {
const html = readFileSync(path.resolve(`${src}${file}`), 'utf-8');
Expand All @@ -27,6 +29,10 @@ readdirSync(src).forEach(file => {
locals: {
title: 'PostHTML Components'
}
},
parserOptions: {
// Don't work
recognizeSelfClosing: false
}
}),

Expand Down
4 changes: 4 additions & 0 deletions docs-src/pages/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<div class="col-lg-8">
<h1 class="display-1 fw-bold mb-4">Playground</h1>

<h2>Self closing tag</h2>
<x-test.self-closing />
<p>Works?</p>

<x-test.div1 aware:myprop="My CUSTOM prop in div1">
<x-test.div2>
<x-test.div3>
Expand Down
3 changes: 3 additions & 0 deletions docs/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<div class="row">
<div class="col-lg-8">
<h1 class="display-1 fw-bold mb-4">Playground</h1>
<h2>Self closing tag</h2>
<div>self closing?</div>
<p>Works?</p>
<div>
div1: My CUSTOM prop in div1
<div>
Expand Down

0 comments on commit 56cdd50

Please sign in to comment.