diff options
author | 2024-07-17 05:14:35 -0700 | |
---|---|---|
committer | 2024-07-17 14:14:35 +0200 | |
commit | eb303e1ad5dade7787c0d9bbb520c21292cf3950 (patch) | |
tree | 731a9f9876f555b920c5f9f0ca88d26e92f73fd3 /packages/integrations/markdoc/test/render.test.js | |
parent | 3b94324228b5b587cadf766a8e112dec3f33642b (diff) | |
download | astro-eb303e1ad5dade7787c0d9bbb520c21292cf3950.tar.gz astro-eb303e1ad5dade7787c0d9bbb520c21292cf3950.tar.zst astro-eb303e1ad5dade7787c0d9bbb520c21292cf3950.zip |
feat(markdoc): Support markdown-it's typographer option (#11450)
* Support markdoc-it's typographer option in markdoc
* Update .changeset/forty-scissors-jog.md [skip ci]
* Update .changeset/forty-scissors-jog.md [skip ci]
* Fix typo in changeset
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/markdoc/test/render.test.js')
-rw-r--r-- | packages/integrations/markdoc/test/render.test.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/integrations/markdoc/test/render.test.js b/packages/integrations/markdoc/test/render.test.js index d439adcd2..4c6d1b415 100644 --- a/packages/integrations/markdoc/test/render.test.js +++ b/packages/integrations/markdoc/test/render.test.js @@ -117,6 +117,15 @@ describe('Markdoc - render', () => { renderWithRootFolderContainingSpace(html); }); + + it('renders content - with typographer option', async () => { + const fixture = await getFixture('render-typographer'); + await fixture.build() + + const html = await fixture.readFile('/index.html'); + + renderTypographerChecks(html); + }); }); }); @@ -173,3 +182,16 @@ function renderWithRootFolderContainingSpace(html) { const p = document.querySelector('p'); assert.equal(p.textContent, 'This is a simple Markdoc post with root folder containing a space.'); } + +/** + * @param {string} html + */ +function renderTypographerChecks(html) { + const { document } = parseHTML(html); + + const h2 = document.querySelector('h2'); + assert.equal(h2.textContent, 'Typographer’s post'); + + const p = document.querySelector('p'); + assert.equal(p.textContent, 'This is a post to test the “typographer” option.'); +} |