[ci] yarn format

This commit is contained in:
FredKSchott 2021-09-03 18:07:39 +00:00 committed by GitHub Actions
parent e282e8e4ac
commit e516f9c953
2 changed files with 14 additions and 11 deletions

View file

@ -5,7 +5,6 @@ title: Built-In Components
Astro includes several builtin components for you to use in your projects. All builtin components are available via `import {} from 'astro/components';`.
## `<Code />`
```astro
@ -24,7 +23,6 @@ This component provides syntax highlighting for code blocks at build time (no cl
You can also use the `<Prism />` component for syntax highlighting powered by the [Prism](https://prismjs.com/) syntax highlighting library. This is the library that Astro's Markdown uses by default. However, we will be transitioning all usage over to `<Code>` as we move towards our v1.0 release.
## `<Markdown />`
```astro

View file

@ -36,7 +36,7 @@ Components('<Code theme="...">', async ({ runtime }) => {
assert.equal($('pre').attr('style'), 'background-color: #2e3440ff; overflow-x: auto;', 'applies custom theme');
});
Components('<Code wrap>', async ({ runtime }) => {
Components('<Code wrap>', async ({ runtime }) => {
{
let result = await runtime.load('/wrap-true');
assert.ok(!result.error, `build error: ${result.error}`);
@ -66,14 +66,19 @@ Components('<Code lang="..." theme="css-variables">', async ({ runtime }) => {
const $ = doc(result.contents);
assert.equal($('pre').length, 1);
assert.equal($('pre').attr('class'), 'astro-code');
assert.equal($('pre, pre span').map((i, f) => f.attribs ? f.attribs.style : 'no style found').toArray(), [
"background-color: var(--astro-code-color-background); overflow-x: auto;",
"color: var(--astro-code-token-constant)",
"color: var(--astro-code-token-function)",
"color: var(--astro-code-color-text)",
"color: var(--astro-code-token-string-expression)",
"color: var(--astro-code-color-text)",
]);
assert.equal(
$('pre, pre span')
.map((i, f) => (f.attribs ? f.attribs.style : 'no style found'))
.toArray(),
[
'background-color: var(--astro-code-color-background); overflow-x: auto;',
'color: var(--astro-code-token-constant)',
'color: var(--astro-code-token-function)',
'color: var(--astro-code-color-text)',
'color: var(--astro-code-token-string-expression)',
'color: var(--astro-code-color-text)',
]
);
});
Components.run();