summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-03-09Prevent HTML-escape of raw strings in JSX script/style tags (#6459)Gravatar Bjorn Lu 4-0/+152
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2023-02-16Support rehype plugins that inject namespaced attributes 2 (#6253)Gravatar Bjorn Lu 1-1/+1
2023-02-15Revert previous mdx breaking change (#6252)Gravatar Bjorn Lu 1-1/+1
2023-02-15[ci] formatGravatar bluwy 1-4/+4
2023-02-15Support rehype plugins that inject namespaced attributes (#6243)Gravatar Bjorn Lu 1-0/+35
* Support rehype plugins that inject namespaced attributes * Fix rehype property casing
2023-02-13Fix head injection in body with slots.render() and head buffering (#6216)Gravatar Matthew Phillips 6-8/+48
* Fix head injection in body with slots.render() and head buffering * Adding a changeset * An MDX test too
2023-02-09[ci] formatGravatar matthewp 1-1/+1
2023-02-09Fix head injection misplacement with Astro.slots.render() (#6196)Gravatar Matthew Phillips 2-0/+35
* Fix head injection misplacement with Astro.slots.render() * Adding a changeset * Fix case of JSX with no layout * missing break
2023-02-07Add additional scoping for head buffering (#6152)Gravatar Matthew Phillips 14-0/+150
* Add additional scoping for head buffering * Add test for direct usage of nested component * Add special scoping for Astro.scopes.render() * Generate propagation map during the build * Move to a maybeHead instruction * Properly serialize for SSR * More conservative scoping * Maybe had should honor result._metadata.hasRenderedHead * Properly type slots * Allow template result to be passed * Add changeset
2023-02-02Prevent eager rendering of head content in multi-level MDX layout (#6107)Gravatar Matthew Phillips 1-2/+2
* Prevent eager rendering of head content in multi-level MDX layout * Adding a changeset * Remove old comment * Keep track of slot position as well
2023-01-30Simplified head injection (#6034)Gravatar Matthew Phillips 12-0/+160
* Simplified head injection * Make renderHead also yield an instruction * Add changeset * Add mdx test
2023-01-26Fix MDX heading IDs generation when using a frontmatter reference (#5978)Gravatar HiDeoo 2-0/+88
* Fix MDX heading IDs generation when using a frontmatter reference * Hoist safelyGetAstroData() call and add statement null check
2023-01-06Add SmartyPants flag (#5769)Gravatar Ben Holmes 2-0/+37
* feat: add smartypants flag * test: smartypants in markdown and mdx * docs: Smartypants -> SmartyPants * chore: changeset * chore: update changeset with 1.0 -> 2.0 in mind * chore: bump to minor change
2023-01-03Markdown and MDX configuration rework (#5684)Gravatar Ben Holmes 2-84/+76
* feat: change extendDefaults -> gfm * deps: remove smartypants from md/remark * tests: update markdown plugin tests * fix: borked lockfile * feat: allow all Markdown options in MDX config, with extend * deps: remove smartypants from MDX * chore: remove unused `mode` property * chore: remark rehype types * chore: dead code * fix: order of default config properties * refactor: move md defaults to remark * fix: RemarkRehype type * fix: apply defaults based on MD defaults * chore: update plugin tests * chore: add syntaxHighlight test * refactor: remove drafts from config defaults * docs: new MDX config options * chore: add changeset * edit: test both extends for syntax highlight * refactor: remove MDX config deep merge * docs: update README and changeset * edit: avoid -> disable Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * edit: `drafts` clarification Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * edit: remove "scare quotes" Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * docs: MDX config options redraft * docs: add migration * chore: changeset heading levels * refactor: githubFlavoredMarkdown -> gfm * chore: remove unused imports Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-03Change frontmatter injection ordering (#5687)Gravatar Ben Holmes 6-16/+15
* feat: make user frontmatter accessible in md * test: new frontmatter injection * refactor: move injection utils to remark pkg * fix: add dist/internal to remark exports * feat: update frontmater injection in mdx * tests: new mdx injection * chore: changeset * chore: simplify frontmatter destructuring * fix: remove old _internal references * refactor: injectedFrontmatter -> remarkPluginFrontmatter * docs: add content collections change * chore: changeset heading levels
2022-12-20MD/MDX collect headings refactor (#5654)Gravatar Chris Swithinbank 1-0/+91
2022-12-05Support rendering `<Fragment>` in MDX `<Content />` component (#5522)Gravatar Chris Swithinbank 9-2/+257
2022-11-22[ci] formatGravatar matthewp 1-12/+16
2022-11-22[MDX] Support remark-rehype options from Astro Markdown config (#5427)Gravatar Thomas Jaggi 2-0/+86
* [MDX] Support remark-rehype options from Astro Markdown config * [MDX] Add remarkRehype to MdxOptions, extend with default markdown config * [MDX] Add remarkRehype to README * [MDX] Fix remarkRehype inheritance, add tests * [MDX] Update remarkRehype docs in README Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * [MDX] Fix remarkRehype docs Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-11-09[ci] formatGravatar matthewp 1-1/+1
2022-11-09Preserve code element node meta for rehype syntax highlighters (#5335)Gravatar Bjorn Lu 2-1/+29
2022-10-24[MDX] Support `recmaPlugins` config (#5146)Gravatar Ben Holmes 2-0/+42
* feat: support recma plugins * chore: add `test:match` to MDX * chore: changeset * docs: add recmaPlugins to README
2022-09-30P5: fix MDX memory leak (#4939)Gravatar Nate Moore 6-0/+60
* fix(astro): tag jsx vnodes with renderer so errors are properly handled * chore: fix missing package in test Co-authored-by: Nate Moore <nate@astro.build>
2022-09-28Remove shamefully-hoist (#4842)Gravatar Bjorn Lu 3-5/+11
2022-09-26[ci] formatGravatar bholmesdev 1-10/+6
2022-09-26Fix: correctly transform `import.meta.env.*` in MDX (#4858)Gravatar Ben Holmes 5-0/+119
* fix: serialize route pattern for Netlify edge Co-authored-by: Jackie Macharia <jackiewmacharia> * fix: escape import.meta.env in MDX compiler output * test: env vars in mdx * chore: changeset * deps: estree-util-visit, @types/estree * feat: inject import.meta.env w/ recma * feat: pull importMetaEnv from vite + astro configs * test: `import.meta.env` in JSX * fix: lockfile * chore: update changeset * fix: remove stray stashed commit
2022-09-01[MDX] Fix: GFM and Smartypants missing by default (#4588)Gravatar Ben Holmes 1-0/+11
* fix: apply Astro defaults on empty md config * chore: changeset
2022-08-30[ci] formatGravatar bholmesdev 1-9/+3
2022-08-30[MDX] Extend Markdown plugin config, with customization options (#4504)Gravatar Ben Holmes 8-173/+206
* test: new combined remark / rehype suite * fix: use with-plugins fixture * chore: remove old mdx plugin tests * docs: add JS docs * docs: update README with thorough example * chore: changeset * fix: add "extends" error message * fix: ignore string-based plugins in md * feat: add warning log for string plugins * docs: highlight `extendPlugins` Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * nit: highlight "extendPlugins" * fix: md plugins type check * chore: "defaults" -> "astroDefaults" * nit: info log when inheriting markdown plugins * refactor: one big log on new behavior * dan: dan nit Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-25Update Markdown type signature to match behavior (#4423)Gravatar Ben Holmes 2-1/+9
* feat: "file" and "url" top-level layout props * test: markdown file and url * test: mdx file and url * feat: update MarkdownInstance + JSDoc improvements * chore: changeset
2022-08-23[ci] formatGravatar matthewp 1-1/+1
2022-08-23Fix MDX style imports when layout is not applied (#4443)Gravatar Ben Holmes 3-0/+14
* fix: add "astro.needsHeadRendering" to MDX * test: style imports in pages without layout * chore: changeset
2022-08-15[ci] formatGravatar bholmesdev 1-3/+5
2022-08-15[MDX] Switch from Shiki Twoslash -> Astro Markdown highlighter (#4292)Gravatar Ben Holmes 1-2/+24
* freat: twoslash -> Astro shiki parser * test: update shiki style check * feat: always apply rehypeRaw * deps: move remark-shiki-twoslash to dev * test: add shiki-twoslash test * docs: update readme with twoslash example * chore: changeset * nit: remove "describe('disabled')"
2022-08-12[ci] formatGravatar bholmesdev 1-1/+4
2022-08-12[MDX] Fix remaining inconsistencies with Markdown (#4268)Gravatar Ben Holmes 4-3/+83
* feat: add "file" and "url" to layout props * feat: add rawContent and compiledContent errs * fix: add "file" and "url" to frontmatter * fix: add separate MDX instance type * types: add MarkdownLayoutProps and MDXLayoutProps * refactor: simplify MDXLayoutProps * test: pass file and url to layout * test: glob components with .default and Content * feat: add <Content /> to MDX * feat: declare MDX type module * fix: [MD] move file and url to layout props only * chore: changeset * chore: bump MDX to "minor" with more details * refactor: remove "file" + "url" top-level props (save for minor) * revert: MDInstance type def updates (save for minor) * fix: MDXInstance "default" + "content" types * fix: bad test layout * chore: remove getHeaders fro *.mdx
2022-08-12[ci] formatGravatar natemoo-re 1-4/+4
2022-08-12Fix namespaced component usage in MDX (#4272)Gravatar Nate Moore 6-0/+109
* fix(#4209): handle namespaced JSX and MDX * chore: add changeset * chore: update lockfile * fix: throw error when componentExport is unresolved * chore: bump compiler * chore: bump compiler * chore: revert example changes Co-authored-by: Nate Moore <nate@astro.build>
2022-08-11[MDX] Pass injected frontmatter to layouts (#4255)Gravatar Ben Holmes 4-0/+37
* fix: move layout generation to remark plugin * test: frontmatter injection in layout * chore: changeset * fix: remove content fallback
2022-08-08[MDX] Remove `frontmatterOptions` (#4204)Gravatar Ben Holmes 3-32/+0
* feat: remove frontmatterOptions config * test: remove custom frontmatter suite * deps: remove remark-mdx-frontmatter * docs: remove `frontmatterOptions` config * chore: changeset
2022-08-05[MDX] Prevent overriding `collect-headings` plugin (#4181)Gravatar Ben Holmes 1-11/+0
* fix: make rehypeCollectHeadings a required plugin * docs: update README on rehypePlugins * test: remove collect-headings override test * docs: remove extends from rehype docs * chore: changeset
2022-08-05[ci] formatGravatar natemoo-re 1-2/+6
2022-08-05Frontmatter injection for MD and MDX (#4176)Gravatar Ben Holmes 11-8/+133
* feat: inject vfile data as exports * feat: add vfile to renderMarkdown output * feat: add safe astroExports parser to utils * refactor: expose vite-plugin-utils on astro package * feat: handle astroExports in mdx * deps: vfile * chore: lockfile * test: astroExports in mdx * refactor: merge plugin exports into forntmatter * refactor: astroExports -> astro.frontmatter * refactor: md astroExports -> astro.frontmatter * feat: astro.frontmatter vite-plugin-markdown * chore: remove unused import * fix: inline safelyGetAstroData in MDX integration * chore: check that frontmatter export is valid export name * chore: error log naming * test: mdx remark frontmatter injection * fix: inconsistent shiki mod resolution * fix: add new frontmatter and heading props * test: remark vdata * fix: spread astro.data.frontmatter * test deps: mdast-util-to-string, reading-time * fix: astro-md test package name * test: md frontmatter injection * fix: layouts * deps: remove vite-plugin-utils export * fix: package lock * chore: remove dup import * chore: changeset * chore: add comment on safelyGetAstroData source * deps: move mdast-util-to-string + reading-time to test fixture * chore: move remark plugins to test fixture * fix: override plugin frontmatter with user frontmatter * test: md injected frontmatter overrides * test: frontmatter injection overrides mdx
2022-08-05Add test for mdx + React usage (#4174)Gravatar Matthew Phillips 5-0/+55
* Add test for mdx + React usage * Add a changeset Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-08-05Handle edge case in jsx-runtime (#4158)Gravatar Nate Moore 6-0/+59
* fix(#4135): handle edge case in jsx-runtime * test: add mdx test case * chore: fix utils reference * test: fix mdx escape test Co-authored-by: Nate Moore <nate@astro.build>
2022-08-04fix missing newline bug in mdx (#4145)Gravatar Fred K. Schott 1-0/+3
2022-08-03[ci] formatGravatar bholmesdev 1-3/+4
2022-08-03[MDX] Add `headings` and `frontmatter` to layout props (#4134)Gravatar Ben Holmes 3-29/+45
* feat: expose headings on layout props * test: frontmatter AND content * test: headings in layouts * chore: changeset
2022-08-02[ci] formatGravatar matthewp 1-1/+1
2022-08-02Load configs with Vite when loading with Proload fails (#4112)Gravatar Matthew Phillips 3-2/+13
* 4078 breaking test * Use Vite for loading the config * Try it * Fallback to loading with Vite only when needed * Remove console.error * Remove extra console.log * Add a changeset * Use middlewareMode