including the language-
class on Prism's <pre>
element (#1180)
* including the `language-` class on Prism's `<pre>` element * adding changeset Co-authored-by: Tony Sullivan <tony.f.sullivan@gmail.com>
This commit is contained in:
parent
aaef6aefef
commit
1e0e2f41cd
3 changed files with 7 additions and 1 deletions
5
.changeset/great-poets-pull.md
Normal file
5
.changeset/great-poets-pull.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Including Prism's `language-` class on code block `<pre>` tags
|
|
@ -42,4 +42,4 @@ if (grammar) {
|
|||
|
||||
---
|
||||
|
||||
<pre class={className}><code class={classLanguage}>{html}</code></pre>
|
||||
<pre class={[className, classLanguage].join(' ')}><code class={classLanguage}>{html}</code></pre>
|
||||
|
|
|
@ -41,6 +41,7 @@ Markdown('Scoped styles should not break syntax highlight', async ({ runtime })
|
|||
|
||||
const $ = doc(result.contents);
|
||||
assert.ok($('pre').is('[class]'), 'Pre tag has scopedStyle class passed down');
|
||||
assert.ok($('pre').hasClass('language-js'), 'Pre tag has correct language');
|
||||
assert.ok($('code').hasClass('language-js'), 'Code tag has correct language');
|
||||
assert.ok($('code span').length > 0, 'There are child spans in code blocks');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue