Skip to content

Commit

Permalink
fix(#2474): ensure namespaced components are properly handled in mark…
Browse files Browse the repository at this point in the history
…down pages
  • Loading branch information
Nate Moore committed May 24, 2022
1 parent ee6e7f9 commit e0475fe
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/astro/test/astro-markdown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ describe('Astro Markdown', () => {
expect($('h1').attr("id")).to.equal('my-blog-post');
});

it('Can handle namespaced components in markdown', async () => {
const html = await fixture.readFile('/namespace/index.html');
const $ = cheerio.load(html);

expect($('h1').text()).to.equal('Hello Namespace!');
expect($('button').length).to.equal(1);
});

it('Correctly handles component children in markdown pages (#3319)', async () => {
const html = await fixture.readFile('/children/index.html');

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Counter from './Counter';

export default {
Counter
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
setup: import ns from '../components/index.js';
---

# Hello Namespace!

<ns.Counter>Click me!</ns.Counter>

0 comments on commit e0475fe

Please sign in to comment.