Skip to content

Commit

Permalink
fix: scoped style (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonai committed Mar 24, 2022
1 parent 60f3c9a commit b5d12c7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/slidev/node/plugins/markdown.ts
Expand Up @@ -180,8 +180,7 @@ export function transformPageCSS(md: string, id: string) {

const result = md.replace(
/(\n<style[^>]*?>)([\s\S]+?)(<\/style>)/g,
(full, start, css, end) => {
const index = md.indexOf(full)
(full, start, css, end, index) => {
// don't replace `<style>` inside code blocks, #101
if (index < 0 || isInsideCodeblocks(index))
return full
Expand Down

0 comments on commit b5d12c7

Please sign in to comment.