diff options
Diffstat (limited to 'packages/markdown')
-rw-r--r-- | packages/markdown/remark/src/index.ts | 2 | ||||
-rw-r--r-- | packages/markdown/remark/src/load-plugins.ts | 7 | ||||
-rw-r--r-- | packages/markdown/remark/src/rehype-collect-headings.ts | 2 | ||||
-rw-r--r-- | packages/markdown/remark/src/rehype-prism.ts | 2 | ||||
-rw-r--r-- | packages/markdown/remark/src/shiki.ts | 6 | ||||
-rw-r--r-- | packages/markdown/remark/src/types.ts | 2 | ||||
-rw-r--r-- | packages/markdown/remark/test/autolinking.test.js | 6 | ||||
-rw-r--r-- | packages/markdown/remark/test/remark-collect-images.test.js | 4 | ||||
-rw-r--r-- | packages/markdown/remark/test/shiki.test.js | 2 |
9 files changed, 19 insertions, 14 deletions
diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index 14d24f76d..66cf00043 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -52,7 +52,7 @@ const isPerformanceBenchmark = Boolean(process.env.ASTRO_PERFORMANCE_BENCHMARK); * Create a markdown preprocessor to render multiple markdown files */ export async function createMarkdownProcessor( - opts?: AstroMarkdownOptions + opts?: AstroMarkdownOptions, ): Promise<MarkdownProcessor> { const { syntaxHighlight = markdownConfigDefaults.syntaxHighlight, diff --git a/packages/markdown/remark/src/load-plugins.ts b/packages/markdown/remark/src/load-plugins.ts index a120b5ab1..37a83827d 100644 --- a/packages/markdown/remark/src/load-plugins.ts +++ b/packages/markdown/remark/src/load-plugins.ts @@ -10,7 +10,12 @@ async function importPlugin(p: string | unified.Plugin<any[], any>) { } export function loadPlugins( - items: (string | [string, any] | unified.Plugin<any[], any> | [unified.Plugin<any[], any>, any])[] + items: ( + | string + | [string, any] + | unified.Plugin<any[], any> + | [unified.Plugin<any[], any>, any] + )[], ): Promise<[unified.Plugin, any?]>[] { return items.map((p) => { return new Promise((resolve, reject) => { diff --git a/packages/markdown/remark/src/rehype-collect-headings.ts b/packages/markdown/remark/src/rehype-collect-headings.ts index 3bff443e2..05afae1ba 100644 --- a/packages/markdown/remark/src/rehype-collect-headings.ts +++ b/packages/markdown/remark/src/rehype-collect-headings.ts @@ -97,7 +97,7 @@ function getMdxFrontmatterVariablePath(node: MdxTextExpression): string[] | Erro expressionPath.push( expression.property.type === 'Literal' ? String(expression.property.value) - : expression.property.name + : expression.property.name, ); expression = expression.object; diff --git a/packages/markdown/remark/src/rehype-prism.ts b/packages/markdown/remark/src/rehype-prism.ts index 7f713ddf2..0dcc5695f 100644 --- a/packages/markdown/remark/src/rehype-prism.ts +++ b/packages/markdown/remark/src/rehype-prism.ts @@ -9,7 +9,7 @@ export const rehypePrism: Plugin<[], Root> = () => { let { html, classLanguage } = runHighlighterWithAstro(language, code); return Promise.resolve( - `<pre class="${classLanguage}" data-language="${language}"><code is:raw class="${classLanguage}">${html}</code></pre>` + `<pre class="${classLanguage}" data-language="${language}"><code is:raw class="${classLanguage}">${html}</code></pre>`, ); }); }; diff --git a/packages/markdown/remark/src/shiki.ts b/packages/markdown/remark/src/shiki.ts index fa29c9c06..0028ec927 100644 --- a/packages/markdown/remark/src/shiki.ts +++ b/packages/markdown/remark/src/shiki.ts @@ -19,7 +19,7 @@ export interface ShikiHighlighter { * Raw `meta` information to be used by Shiki transformers */ meta?: string; - } + }, ): Promise<string>; } @@ -30,7 +30,7 @@ const ASTRO_COLOR_REPLACEMENTS: Record<string, string> = { }; const COLOR_REPLACEMENT_REGEX = new RegExp( `${Object.keys(ASTRO_COLOR_REPLACEMENTS).join('|')}`, - 'g' + 'g', ); let _cssVariablesTheme: ReturnType<typeof createCssVariablesTheme>; @@ -63,7 +63,7 @@ export async function createShikiHighlighter({ } catch (_err) { // eslint-disable-next-line no-console console.warn( - `[Shiki] The language "${lang}" doesn't exist, falling back to "plaintext".` + `[Shiki] The language "${lang}" doesn't exist, falling back to "plaintext".`, ); lang = 'plaintext'; } diff --git a/packages/markdown/remark/src/types.ts b/packages/markdown/remark/src/types.ts index e3496ec5d..aa7b62c9a 100644 --- a/packages/markdown/remark/src/types.ts +++ b/packages/markdown/remark/src/types.ts @@ -57,7 +57,7 @@ export interface AstroMarkdownOptions { export interface MarkdownProcessor { render: ( content: string, - opts?: MarkdownProcessorRenderOptions + opts?: MarkdownProcessorRenderOptions, ) => Promise<MarkdownProcessorRenderResult>; } diff --git a/packages/markdown/remark/test/autolinking.test.js b/packages/markdown/remark/test/autolinking.test.js index 966d5e303..3fd5ad0fc 100644 --- a/packages/markdown/remark/test/autolinking.test.js +++ b/packages/markdown/remark/test/autolinking.test.js @@ -16,7 +16,7 @@ describe('autolinking', () => { assert.equal( code.replace(/\n/g, ''), - `<p>See <a href="https://example.com">https://example.com</a> for more.</p>` + `<p>See <a href="https://example.com">https://example.com</a> for more.</p>`, ); }); @@ -26,7 +26,7 @@ describe('autolinking', () => { assert.equal( code.trim(), - `<p>See <a href="http://www.example.com">www.example.com</a> for more.</p>` + `<p>See <a href="http://www.example.com">www.example.com</a> for more.</p>`, ); }); @@ -36,7 +36,7 @@ describe('autolinking', () => { assert.equal( code.trim(), - `<p>See <code>https://example.com</code> or <code>www.example.com</code> for more.</p>` + `<p>See <code>https://example.com</code> or <code>www.example.com</code> for more.</p>`, ); }); }); diff --git a/packages/markdown/remark/test/remark-collect-images.test.js b/packages/markdown/remark/test/remark-collect-images.test.js index cdfccf9c8..025d909aa 100644 --- a/packages/markdown/remark/test/remark-collect-images.test.js +++ b/packages/markdown/remark/test/remark-collect-images.test.js @@ -20,7 +20,7 @@ describe('collect images', async () => { assert.equal( code, - '<p>Hello <img __ASTRO_IMAGE_="{"src":"./img.png","alt":"inline image url","index":0}"></p>' + '<p>Hello <img __ASTRO_IMAGE_="{"src":"./img.png","alt":"inline image url","index":0}"></p>', ); assert.deepEqual(Array.from(imagePaths), ['./img.png']); @@ -34,7 +34,7 @@ describe('collect images', async () => { assert.equal( code, - '<p>Hello <img __ASTRO_IMAGE_="{"src":"./img.webp","alt":"image ref","index":0}"></p>' + '<p>Hello <img __ASTRO_IMAGE_="{"src":"./img.webp","alt":"image ref","index":0}"></p>', ); assert.deepEqual(Array.from(metadata.imagePaths), ['./img.webp']); diff --git a/packages/markdown/remark/test/shiki.test.js b/packages/markdown/remark/test/shiki.test.js index 149fa38bb..c3cb81370 100644 --- a/packages/markdown/remark/test/shiki.test.js +++ b/packages/markdown/remark/test/shiki.test.js @@ -46,7 +46,7 @@ describe('shiki syntax highlighting', () => { `\ - const foo = "bar"; + const foo = "world";`, - 'diff' + 'diff', ); assert.match(html, /user-select: none/); |