0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
Commit graph

155 commits

Author SHA1 Message Date
Viktor Szépe
a146cf1012
Fix typos (#10923) 2024-05-01 13:56:38 +08:00
Emanuele Stoppa
347bdfe550 [ci] format 2024-04-17 08:38:53 +00:00
Bjorn Lu
88ee63a3ba
Remove MDX processor on buildEnd (#10770) 2024-04-15 15:56:53 +08:00
604qgc
c3008fd85a [ci] format 2024-04-10 16:56:31 +00:00
604qgc
ccafa8d230
Adds dataLanguage property to the replacement <pre> element. (#10538)
* Update highlight.ts

* Create cold-snakes-train.md

* Update Code.astro

Solution for use-case described in withastro/roadmap#276 (https://github.com/withastro/roadmap/discussions/276)

* roll-back initial fix

* new fix

* update changeset

* Update packages/markdown/remark/src/rehype-prism.ts

* Update .changeset/cold-snakes-train.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/cold-snakes-train.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/cold-snakes-train.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/cold-snakes-train.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-04-10 12:55:31 -04:00
Bjorn Lu
2cf116f80c
Remove deprecated APIs from @astrojs/markdown-remark (#10629)
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-04-01 22:53:54 +08:00
James Garbutt
374efcdff9
Lazy loaded shiki languages during syntax highlighting (#10618) 2024-04-01 22:52:50 +08:00
Kyle Nguyen
c585528f44
fix: use Shiki's isSpecialLang to allow ansi codeblocks (#10540)
* fix: use `isSpecialLang` instead of hardcode

Hardcoding this value makes it impossible to use Shiki's `ansi` feature

* Add changeset
2024-03-25 15:44:08 -04:00
Bjorn Lu
19e42c3681
Pass meta to shiki transformers (#10494) 2024-03-20 19:15:07 +08:00
Emanuele Stoppa
dfd146f591
Revert "[ci] format" (#10417)
* Revert "[ci] format"

This reverts commit 1863727215.

* pin dependency

* update lock
2024-03-13 09:55:24 +00:00
Houston (Bot)
1863727215 [ci] format 2024-03-13 05:53:52 +00:00
Bjorn Lu
d9336668e5 [ci] format 2024-03-08 13:04:14 +00:00
StandardGage
c081adf998
Allow Code Component to have custom props and extra class styles (#9960)
* Create simple react element if element has no children

* Fix for when element has text

* add changeset

* Add additionalProps to Code component and ShikiHighlighter.highlight()

* Add changeset

* Create simple react element if element has no children

* Fix for when element has text

* add changeset

* Add additionalProps to Code component and ShikiHighlighter.highlight()

* Add changeset

* reverted accidental changes

* remove unnecessary parts

* Add HTMLAttributes type to additionalProps

* Update .changeset/calm-bags-deliver.md

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

* extend HTMLAtts instead

* add suggestions

* feat: address reviews

* chore: remove empty line

* feat: move attributes to options

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-03-08 13:02:53 +00:00
Erika
c7edb22b4b [ci] format 2024-03-08 10:58:49 +00:00
Remco Haszing
a31bbd7ff8
fix(markdown): don’t generate mdast html nodes (#10104)
* fix(markdown): don’t generate mdast html nodes

`html` nodes from mdast are converted to `raw` hast nodes. These nodes
are then not processed by proper rehype plugins. Typically if a remark
plugin generates `html` nodes, this indicates it should have actually
been a rehype plugin.

This changes the remark plugins that generate `html` nodes into rehype
nodes. These were `remarkPrism` and `remarkShiki`.

Closes #9909

* Apply suggestions from code review

* refactor(mdx): move user defined rehype plugins after syntax highlighting

* fix(mdx): fix issue in mdx rehype plugin ordering

* docs: explain why html/raw nodes are avoided in changeset

This also includes some hints on what users could do to upgrade of they
rely on these nodes.

* Fix MDX rehype plugin ordering

* refactor(remark): restore remarkPrism and remarkShiki

They aren’t used anymore, but removing would be a breaking change.

* chore: mark deprecated

* Apply suggestions from code review

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/thirty-beds-smoke.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-03-08 10:53:39 +00:00
Bjorn Lu
5a9528741f
Move to shiki and stabilize dual themes support (#10130)
* Update to shiki

* Stabilize shikiConfig.experimentalThemes

* Add changeset

* Fix merge issues
2024-03-08 10:53:19 +00:00
Emanuele Stoppa
2dd00a0024
chore: import sort source code, exception for the astro package (#10242)
* chore: import sort source code, exception for the `astro` package

* fix import sorting bug

* Update packages/integrations/lit/server.js

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>

---------

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-02-27 11:15:27 +00:00
Bjorn Lu
436841e97e
Use eslint-plugin-regexp (#9993) 2024-02-07 20:43:19 +08:00
ktym4a
44c957f893
Fix a bug that Japanese files were not displayed correctly. (#9866)
* Fix: Fix a bug that Japanese files were not displayed correctly.

* chore: generate change description

* Update .changeset/cool-colts-watch.md

* add test case for non-UTF-8 file name

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-01-29 16:42:44 +00:00
Degreat
2f81cffa9d
normalize class property (#9723)
* normalize class property

* Add changeset

* properly type return value

* normalize styles, rename function

* properly describe change

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>

---------

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-01-22 20:00:00 +00:00
Bjorn Lu
a505190933
Make @astrojs/markdown-remark browser-safe (#9738) 2024-01-20 18:59:40 +08:00
Bjorn Lu
53c69dcc82
Fix @astrojs/markdown-remark bundling for non-node runtimes (#9736) 2024-01-19 22:38:33 +08:00
Oliver Speir
bc2edd4339 [ci] format 2024-01-17 13:14:53 +00:00
Oliver Speir
165cfc154b
Allow remark plugins to affect getImage call for .md files (#9566)
* pass hProperties to getImage for optimized imgs

* fix to allow multiple images to have hProps added

* update test to reflect new expected result

* add comment back in

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>

* add srcset

* works on multiple images

* fix tests, fix images.ts type and remove console logs

* add warning back to images.ts again lol

* update changeset to be user oriented

* Update calm-socks-shake.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* pass alt through getImage

* added fixture and test

* update lockfile

* fix lockfile again (had installed an extra package during testing and had sharp33 installed)

* update test to reflect passing alt through getImage

---------

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-01-17 13:13:31 +00:00
Degreat
e9a72d9a91
Bump shikiji, use transformers API, expose transformers API (#9643)
* Bump shikiji, use transformers API, expose transformers API

* update astro config schema

* include shikiji-core

* Use default import

* address css-variables theme

* Remove shikiji markdoc

* Improve schema transformers handling

* Fix tests

* Update changeset

* bump shikiji version

* Update .changeset/six-scissors-worry.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update wording

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: bluwy <bjornlu.dev@gmail.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-01-17 13:13:05 +00:00
Bjorn Lu
153a5abb90
Remove deprecated features from Astro 3.0 (#9168) 2023-11-28 00:44:20 +08:00
Bjorn Lu
c7953645ee
Remove deprecated markdown-remark APIs (#9182) 2023-11-28 00:32:39 +08:00
Bjorn Lu
addb57c8e8
Fix RemarkRehype types (#9147) 2023-11-22 11:17:29 +08:00
Bjorn Lu
abf601233f
Update all dependencies (#9138)
Co-authored-by: delucis <delucis@users.noreply.github.com>
2023-11-21 12:09:19 +08:00
bluwy
0aee43fc16 [ci] format 2023-11-14 15:01:58 +00:00
Bjorn Lu
4537ecf0d0
Refactor shikiji syntax highlighting code (#9083) 2023-11-14 23:00:17 +08:00
horo
c5010aad34
Light/dark theming for shikiji's codeblocks (#8903)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-11-08 22:42:05 +08:00
Bjorn Lu
c4270e4768
Use shikiji (#8502)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-10-12 00:07:06 +08:00
Chris
21f4826576
Fixes: Shiki syntax highlighting adds is:raw attribute to the HTML output (#8715)
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2023-10-04 18:23:58 +08:00
Bjorn Lu
74dc3edb30
Improve MDX rendering performance (#8533) 2023-09-14 20:05:38 +08:00
Bjorn Lu
7522bb4914
Improve markdown rendering performance (#8532) 2023-09-14 18:22:16 +08:00
Lars Kappert
d93987824d
feat(markdown): Add support for imageReference paths when collecting images (#8475) 2023-09-13 17:29:39 +02:00
Erika
4e395a6cab
config: migrate us to moduleResolution: 'node16' (#8519) 2023-09-13 16:49:22 +02:00
Bjorn Lu
f3f62a5a20
Refactor mdx remark plugins (#8430) 2023-09-07 22:28:02 +08:00
Bjorn Lu
e79e3779df
Remove pre-shiki v0.14 theme names (#8169) 2023-08-21 21:02:30 +08:00
Erika
b76c166bdd
feat: unflag experimental.assets (#7921)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2023-08-16 10:21:05 +02:00
Bjorn Lu
d8bae784b4
Fix organize-imports-cli with satisfies operator (#7727) 2023-07-20 20:47:36 +08:00
Princesseuh
1c85b39d38 [ci] format 2023-07-18 00:20:47 +00:00
Erika
f14e48098a
nit: use node: prefix everywhere (#7692)
* nit: use `node:` prefix everywhere

* nit: fs/promises too

* test: workaround issue in node builtin detection
2023-07-18 02:17:59 +02:00
Josh Goldberg ✨
2fea174303
feat: use typescript-eslint@v6's reworked configs (#7425) 2023-07-03 20:59:43 +08:00
Bjorn Lu
49514e4ce4
Upgrade shiki to v0.14.1 (#6932)
* Upgrade shiki

* Update themes

* Update languages

* Simplify

* Fix compat for other remark code

* Update theme again

* Fix language gen

* Add changeset

* Fix code

* Update test theme colors

* Update changeset

* Fix test again
2023-05-03 11:07:57 -04:00
matthewp
704d61e777 [ci] format 2023-04-13 18:12:26 +00:00
Houston (Bot)
0f4c005750
[ci] update lockfile (#6837)
* [ci] update lockfile

* Fix type errors

* Fix zod version

* updated lockfile

* fix tests

---------

Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2023-04-13 14:09:19 -04:00
Princesseuh
c464bf258f [ci] format 2023-04-13 09:56:50 +00:00
Erika
2511d58d58
feat(mdx): Add support for turning ![]() into <Image> (#6824) 2023-04-13 11:54:40 +02:00