summaryrefslogtreecommitdiff
path: root/packages/astro/src/compiler/transform/styles.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro/src/compiler/transform/styles.ts')
-rw-r--r--packages/astro/src/compiler/transform/styles.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/astro/src/compiler/transform/styles.ts b/packages/astro/src/compiler/transform/styles.ts
index 10d43af53..cfade44b0 100644
--- a/packages/astro/src/compiler/transform/styles.ts
+++ b/packages/astro/src/compiler/transform/styles.ts
@@ -196,8 +196,15 @@ export default function transformStyles({ compileOptions, filename, fileID }: Tr
html: {
InlineComponent: {
enter(node) {
- if (node.name !== 'Markdown') return;
- injectScopedClassAttribute(node, scopedClass, '$scope');
+ if (node.name === 'Markdown') {
+ injectScopedClassAttribute(node, scopedClass, '$scope');
+ }
+ for(let attr of node.attributes) {
+ if(attr.name === 'class') {
+ injectScopedClassAttribute(node, scopedClass, 'class');
+ break;
+ }
+ }
},
},
Element: {