summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar matthewp <matthewp@users.noreply.github.com> 2022-08-25 21:24:13 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2022-08-25 21:24:13 +0000
commit4faee5afed04a12499f56cf74b06c362ec584da9 (patch)
tree3d700ed2975885a44a04a7ab57c6d89b37672e19
parentac03218247763e4782824e220a384fd20ae6d769 (diff)
downloadastro-4faee5afed04a12499f56cf74b06c362ec584da9.tar.gz
astro-4faee5afed04a12499f56cf74b06c362ec584da9.tar.zst
astro-4faee5afed04a12499f56cf74b06c362ec584da9.zip
[ci] format
-rw-r--r--packages/astro/src/@types/astro.ts4
-rw-r--r--packages/astro/test/astro-markdown-plugins.test.js19
2 files changed, 12 insertions, 11 deletions
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts
index 4b4948671..5cd7abe24 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -650,7 +650,7 @@ export interface AstroUserConfig {
* @description
* Pass [remark plugins](https://github.com/remarkjs/remark) to customize how your Markdown is built. You can import and apply the plugin function (recommended), or pass the plugin name as a string.
*
- * :::caution
+ * :::caution
* Providing a list of plugins will **remove** our default plugins. To preserve these defaults, see the `extendDefaultPlugins` flag.
* :::
*
@@ -671,7 +671,7 @@ export interface AstroUserConfig {
* @description
* Pass [rehype plugins](https://github.com/remarkjs/remark-rehype) to customize how your Markdown's output HTML is processed. You can import and apply the plugin function (recommended), or pass the plugin name as a string.
*
- * :::caution
+ * :::caution
* Providing a list of plugins will **remove** our default plugins. To preserve these defaults, see the `extendDefaultPlugins` flag.
* :::
*
diff --git a/packages/astro/test/astro-markdown-plugins.test.js b/packages/astro/test/astro-markdown-plugins.test.js
index c65284177..b2958f817 100644
--- a/packages/astro/test/astro-markdown-plugins.test.js
+++ b/packages/astro/test/astro-markdown-plugins.test.js
@@ -14,8 +14,11 @@ async function buildFixture(config) {
function remarkExamplePlugin() {
return (tree) => {
- tree.children.push({ type: 'paragraph', children: [{ type: 'text', value: 'Remark plugin applied!' }] })
- }
+ tree.children.push({
+ type: 'paragraph',
+ children: [{ type: 'text', value: 'Remark plugin applied!' }],
+ });
+ };
}
describe('Astro Markdown plugins', () => {
@@ -48,28 +51,26 @@ describe('Astro Markdown plugins', () => {
const fixture = await buildFixture({
markdown: {
remarkPlugins: [remarkExamplePlugin],
- rehypePlugins: [
- [addClasses, { 'h1,h2,h3': 'title' }],
- ],
+ rehypePlugins: [[addClasses, { 'h1,h2,h3': 'title' }]],
extendDefaultPlugins,
},
});
const html = await fixture.readFile('/with-gfm/index.html');
const $ = cheerio.load(html);
-
+
// test 1: GFM autolink applied correctly
if (extendDefaultPlugins === true) {
expect($('a[href="https://example.com"]')).to.have.lengthOf(1);
} else {
expect($('a[href="https://example.com"]')).to.have.lengthOf(0);
}
-
+
// test 2: (sanity check) remark plugins still applied
expect(html).to.include('Remark plugin applied!');
-
+
// test 3: (sanity check) rehype plugins still applied
expect($('#github-flavored-markdown-test')).to.have.lengthOf(1);
expect($('#github-flavored-markdown-test').hasClass('title')).to.equal(true);
- })
+ });
}
});