From efc604813786a22f3c5f7b20487712b8b3e3cab4 Mon Sep 17 00:00:00 2001 From: Farnabaz Date: Wed, 9 Aug 2023 10:41:27 +0200 Subject: [PATCH] fix(slot): rename ContentSlot to MDCSlot in render function --- pnpm-lock.yaml | 6 +++--- src/module.ts | 3 ++- test/features/highlighter.ts | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 70bebed99..2fbf14dff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,7 +37,7 @@ dependencies: version: 2.0.0 nuxt-mdc: specifier: npm:nuxt-mdc-edge@latest - version: /nuxt-mdc-edge@0.0.2-28174420.1209210(rollup@3.26.3) + version: /nuxt-mdc-edge@0.0.2-28185536.2ce38f3(rollup@3.26.3) ohash: specifier: ^1.1.2 version: 1.1.2 @@ -6848,8 +6848,8 @@ packages: - supports-color dev: true - /nuxt-mdc-edge@0.0.2-28174420.1209210(rollup@3.26.3): - resolution: {integrity: sha512-YHBkFFli5dsRY72UQU5E0Y4SPk0F9oKK7x98tPBB6A6VD7UY8EGZY5lHQ9rvwTI+ZlMy5fSObHCLWW6rYsPG1w==} + /nuxt-mdc-edge@0.0.2-28185536.2ce38f3(rollup@3.26.3): + resolution: {integrity: sha512-ZnYCIoyjX5+fQ7HeUd4S6aiRuWgKXg7BuBbC4z/lVZBxgepg3osO4j9mBnMSG5/mpnuYIdwNvmqlpL5VVriYsA==} dependencies: '@nuxt/kit': 3.6.5(rollup@3.26.3) '@types/hast': 3.0.0 diff --git a/src/module.ts b/src/module.ts index 98c835ac6..b91e1d5a0 100644 --- a/src/module.ts +++ b/src/module.ts @@ -327,10 +327,11 @@ export default defineNuxtModule({ name: 'content-slot', enforce: 'pre', transform (code) { - if (code.includes('/g, '') code = code.replace(/ { const styleElement = parsed.body.children.pop() expect(styleElement.tag).toBe('style') const style = styleElement.children[0].value - const code = parsed.body.children[0].children[0].children + const code = parsed.body.children[0].children[0].children[0].children for (const token of code) { expect(style).toContain(`.${token.props.class}`)