summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-12-22[Content] Throw on relative image usage (#5648)Gravatar Ben Holmes 3-0/+64
* chore: add rel image error plugin * deps: mdast, mdast types * chore: add rel image throw to mdx * refactor: doc rel image path plugin * fix: respect experimental flag in md remark * chore: changeset * deps: remove mdast package * fix: resolve contentDir from config * fix: apply MDX plugin after user plugins * fix: stub out contentDir
2022-12-20MD/MDX collect headings refactor (#5654)Gravatar Chris Swithinbank 3-61/+70
2022-09-28[ci] formatGravatar bluwy 1-2/+2
2022-09-28Remove shamefully-hoist (#4842)Gravatar Bjorn Lu 1-1/+14
2022-08-28chore: updated shiki (#4519)Gravatar Juan Martín Seery 1-6/+16
* Upgraded shiki * Use setColorReplacements * no-shadow * Changeset
2022-08-25[MD] `extendDefaultPlugins` to preserve default remark plugins (#4474)Gravatar Ben Holmes 2-3/+5
* feat: add { extends } to markdown config * test: remark plugins with extends * deps: pnpm lock * chore: changeset * fix: remarkPlugins -> rehypePlugins * docs: update markdown config reference * Revert "feat: add { extends } to markdown config" This reverts commit 5d050bbcf9a2c0d470cae79c4d0a954d489f4e8c. * feat: new "extendDefaultPlugins" flag * docs: update config * nit: We -> Astro applies * fix: backticks on `false` * nit: Note -> REAL note Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * docs: note -> caution Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-08-25[ci] formatGravatar matthewp 1-2/+2
2022-08-25make Remark rehype options available in astro config (#4138)Gravatar gtnbssn 2-0/+12
* make remark-rehype config available in astro.config.mjs * add test for remark-rehype config, checks that footnotes can be translated * update lockfile to take the added test into account * omit handlers and unkownHandler from the RemarkRehype type * define RemarkRehype with proper references to the handler and handlers types * formatting * changeset Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-08-05[ci] formatGravatar natemoo-re 1-1/+1
2022-08-05Frontmatter injection for MD and MDX (#4176)Gravatar Ben Holmes 3-5/+18
* 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-05[markdown] Harder, better, faster, stronger `vite-plugin-markdown` (#4137)Gravatar Ben Holmes 1-1/+1
* refactor: vite-plugin-md -> vite-plugin-md-legacy * wip: add vite-plugin-md * feat: always apply jsx renderer * fix: markHTMLString on VNode result * feat: apply new vite-plugin-markdown! * fix: add meta export to md * fix: remove needless $$metadata export * fix: toggle to legacy plugin on flag * fix: pass fileId to renderMarkdown * test: raw and compiled content on plain md * fix: escape vite env refs * refactor: astro-md -> legacy-astro-flavored-md, astro-md-mode -> astro-markdown * fix: import.meta.env refs with tests * fix: add pkg.json to clientAddress * fix: prefer JSX integration over Astro runtime * Revert "fix: prefer JSX integration over Astro runtime" This reverts commit 3e5fa49344be9c857393da9af095faab152e92e1. * fix: remove .mdx check on importSource * chore: changeset * chore: remove TODO * fix: add back getHeadings * fix: add pkg.json to astro-head fixture * fix: default to Astro renderer for MDX and MD * feat: add "headings" and "frontmatter" to md layouts * refactor: remove legacy flag conditionals from legacy plugin * fix: add back MDX warning when legacy is off * test: getHeadings() glob * fix: add error on "astro.headings" access * feat: update docs example astro.headings => headings * refactor: readFile as string w/ utf-8 * chore: remove astro metadata TODO * refactor: stringify HTML once * fix: add pkg.json to glob-pages-css
2022-08-05[ci] formatGravatar hippotastic 1-1/+1
2022-08-05Fix double-escaping of non-highlighted code blocks in Astro-flavored ↵Gravatar hippotastic 1-2/+3
markdown (#4169)
2022-08-02Refactor @astrojs/prism, fix Prism component import not working (#4114)Gravatar Erika 1-43/+2
* Upgrade @astrojs/prism to a real package, fix component import not working * Remove `@astrojs/prism` as a dependency of `astro` * Update lock file * Refactor to multiple files * Oops, can't have astro imports run inside node * Follow Nate's suggestion on being minors instead of patchs * Update lockfile
2022-07-26Add tests for markdown content escaping (#4058)Gravatar Matthew Phillips 1-1/+5
2022-07-23Rename Markdown util `getHeaders()` to `getHeadings()` (#4031)Gravatar Nate Moore 3-14/+14
* Renamed getHeaders() to getHeadings(), according to RFC #208. * chore: update changeset * fix: expose MarkdownHeading type from `astro` Co-authored-by: Félix Sanz <me@felixsanz.com> Co-authored-by: Nate Moore <nate@astro.build>
2022-07-22[ci] formatGravatar tony-sull 1-1/+1
2022-07-22Feat: new `legacy.astroFlavoredMarkdown` flag (#4016)Gravatar Ben Holmes 2-6/+6
* refactor: add legacy.jsxInMarkdown flag to config * refactor: jsxInMarkdown -> astroFlavoredMarkdown * refactor: remove `markdown.mode` * feat: wire up legacy.astroFlavoredMarkdown * test: add legacy to astro-markdown fixture * test: remark autolinking * test: remark components * test: remark expressions * test: remark strictness * chore: remove "mode" from md component * chore: remove "mode: md" from tests * Fixing legacy MD tests, adding named slots tests for MDX pages * chore: update lock file * WIP: debugging named slots in MDX * fix: handle named slots in MDX properly * chore: re-enabling slots tests for MDX pages * fixing test validation for svelte & vue * removing unused Tailwind test * legacy flag for Markdown component tests * adding is:raw to Markdown component test * adding is:raw to all Markdown component test fixtures * can't use is:raw when nesting markdown components * another nested test can't use is:raw * one more <Markdown> test fix * fixing another JSX markdown component test * chore: add changeset * e2e tests were missing the legacy flag * removing the broken tailwind E2E markdown page Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com> Co-authored-by: Nate Moore <nate@astro.build>
2022-07-21[ci] formatastro@0.0.0-rc-20220722032928@astrojs/vue@0.0.0-rc-20220722032928@astrojs/vercel@0.0.0-rc-20220722032928@astrojs/tailwind@0.0.0-rc-20220722032928@astrojs/svelte@0.0.0-rc-20220722032928@astrojs/sitemap@0.0.0-rc-20220722032928@astrojs/prefetch@0.0.0-rc-20220722032928@astrojs/partytown@0.0.0-rc-20220722032928@astrojs/node@0.0.0-rc-20220722032928@astrojs/netlify@0.0.0-rc-20220722032928@astrojs/mdx@0.0.0-rc-20220722032928@astrojs/markdown-remark@0.0.0-rc-20220722032928@astrojs/markdown-component@0.0.0-rc-20220722032928@astrojs/lit@0.0.0-rc-20220722032928@astrojs/image@0.0.0-rc-20220722032928@astrojs/deno@0.0.0-rc-20220722032928@astrojs/cloudflare@0.0.0-rc-20220722032928Gravatar bholmesdev 1-15/+15
2022-07-21Fix: use `set:html` when markdown mode is `md` (#4008)Gravatar Ben Holmes 1-8/+10
* refactor: add legacy.jsxInMarkdown flag to config * fix: use `set:html` when `markdown.mode` is 'md' * Revert "refactor: add legacy.jsxInMarkdown flag to config" This reverts commit 5572e8d9b33eb1e9168d221f22348d3b3cb4b29a. * fix: move `remarkUnwrap, remarkEscape` to MDX only * fix: only apply scary HTML passthroughs on MDX * fix: move all JSX-specific rehype plugins under `isMDX` * fix: "allowDangerousHtml" for md (required for Shiki) * fix: apply `set:html` for non-layouts too * test: JSX expressions, components, syntax highlighting * chore: changeset * fix: ignore "setup" and "components" in plain MD mode * refactor: create new fixture to avoid weird caching error * fix: dup package name * chore: update lock * fix: apply rehypeCollectHeaders to md
2022-07-19[ci] formatastro@0.0.0-rc-20220719055619@astrojs/vue@0.0.0-rc-20220719055619@astrojs/svelte@0.0.0-rc-20220719055619@astrojs/image@0.0.0-rc-20220719055619Gravatar FredKSchott 1-5/+5
2022-07-18Removes trailing dash from generated slugs in markdown (#3044)Gravatar Rafid Muhymin Wafi 1-1/+5
* fixed header slugs in markdown if ends with a dash * added changeset * removes trailing dash only if slug was created * updated test * updated change level from patch to minor
2022-07-18ci: fix eslint issues (#3969)Gravatar Juan Martín Seery 1-0/+1
2022-07-18Revert "Removes trailing dash from generated slugs in markdown (#3044)"Gravatar Fred K. Schott 1-5/+1
This reverts commit 8530cce14f9953e0e5d6b12807720e62b9b5cf1f.
2022-07-18remove ssr-utils file (#3924)Gravatar Fred K. Schott 1-8/+0
2022-07-16[ci] formatGravatar RafidMuhymin 1-5/+5
2022-07-16Removes trailing dash from generated slugs in markdown (#3044)Gravatar Rafid Muhymin Wafi 1-1/+5
* fixed header slugs in markdown if ends with a dash * added changeset * removes trailing dash only if slug was created * updated test * updated change level from patch to minor
2022-07-14[ci] formatGravatar FredKSchott 1-1/+1
2022-07-14add back missing ssr-utils.ts file (#3919)Gravatar Fred K. Schott 1-0/+8
2022-07-13fix: don't throw when Shiki doesn't recognize a language (#3911)Gravatar Juan Martín Seery 1-1/+15
* Don't throw when Shiki doesn't recognise a language * Changeset
2022-07-11Fix: reintroduce smoke tests across example projects (#3669)Gravatar Nate Moore 1-8/+0
* chore: update smoke tests * chore: bump smoke tests to node@16 * chore: remove gitmodules * chore(ci): prefer node@14 * wip: remove path from smoke clone step * feat: run build:examples from test:smoke * fix: remove no-frozen-lockfile * fix: checkout monorepo last for pnpm setup * wip: replace @astrojs/markdown/remark import from md * fix: remove type defs from generated file * fix: function order * chore: remove ssr-utils export * wip: remove windows from smoke test * fix: instantiate slugger in snippet * fix: exclude with-mdx from smoke (for now) * fix: add quotes on filter flag for safety * chore: changeset * wip: try reintroducing windows smoke * sad chore: remove client: directive from with-mdx * Revert "wip: try reintroducing windows smoke" This reverts commit 9529b1a45c007286c22861e106b82200545e4198. Co-authored-by: Nate Moore <nate@astro.build> Co-authored-by: bholmesdev <hey@bholmes.dev>
2022-06-22Enables eslint on the full repo and adds a rule for no `only()` tests (#3659)Gravatar Tony Sullivan 3-8/+10
* enabling eslint on the all packages and tests * enabling for all packages * TEMP: adding an only() test to verify it fails CI * using our eslint config and ignore in CI * removing the temporary .only() test * update lock file * lint: fixing new test with a no-shadow warning * chore: update lock file
2022-06-20Encode ampersands in markdown code blocks (#3630)Gravatar Tony Sullivan 1-1/+1
* encode ampersands in markdown code blocks * chore: add changeset * nit: fixing test case description
2022-06-20[ci] formatGravatar tony-sull 1-4/+2
2022-06-20Fixes rendering of HTML comments inside markdown code blocks (#3638)Gravatar Tony Sullivan 2-1/+19
* JS comment wrappers should be removed from HTML comments in code blocks * chore: add changeset
2022-06-17Remove extra newlines around Markdown components (#3620)Gravatar hippotastic 2-3/+3
2022-06-16Fix: Netlify edge deployment when using markdown (#3612)Gravatar Ben Holmes 2-6/+8
* wip: revert sitemap PR * fix: extract SSR-ready "slug" helper to separate module * Un-revert sitemap PR. Not to blame! This reverts commit 7cd2a8a5ea1e9fdee6837425881328928ceff852. * fix: use .netlify for edge deployment test * refactor: add md file to edge function fixture * fix: add netlify edge tests to ci * chore: remove stray console log * wip: undo "dist" change on edge tests * chore: changeset * Revert "wip: undo "dist" change on edge tests" This reverts commit 70e565ef06b228150547bca92bc12d1c236c0ed9. * temp: add ignore to breaking edge tests
2022-06-15Consolidate hydration scripts into just one (#3571)Gravatar Matthew Phillips 2-6/+6
* Remove redundant hydration scripts * Prebuild the island JS * Fix build * Updates to tests * Update more references * Custom element test now has two classic scripts * Account for non-default exports * Restructure hydration directives * Move nested logic into the island component * Remove try/catch
2022-06-10Fix remarkMdxish performance issue on huge sites (#3572)Gravatar hippotastic 1-4/+9
2022-06-10[ci] formatGravatar natemoo-re 2-5/+4
2022-06-09Fix autolinking of URLs inside links in Markdown (#3564)Gravatar hippotastic 2-19/+36
2022-06-08[ci] formatGravatar natemoo-re 2-10/+6
2022-06-08Allow AlpineJS syntax extensions in Markdown (#3554)Gravatar hippotastic 2-1/+32
* Allow AlpineJS syntax extensions in Markdown * Remove unwanted MDX ESM import/export support
2022-06-06[ci] formatfix/map-file-404-logsGravatar FredKSchott 7-19/+19
2022-06-03[ci] formatGravatar natemoo-re 1-14/+20
2022-06-03Fix Markdown errors missing source filename (#3514)Gravatar hippotastic 1-0/+27
2022-06-03Fix: Allow self-closing tags in Markdown (#3516)Gravatar hippotastic 1-1/+36
2022-06-03Fix cases for JSX-like expressions in code blocks of headings (#3502)Gravatar nokazn 1-9/+14
* chore: fix typo in remark tests * test: add test cases for markdown expressions in header * fix: avoid evaluating JSX-like expressions inside inline code in heading * fix: generate slug for id including values in backtick blocks
2022-05-31[ci] formatGravatar natemoo-re 1-3/+2
2022-05-31Fix components in markdown regressions (#3486)Gravatar hippotastic 2-43/+46
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>