Skip to content

Commit

Permalink
fix(cli): whitespace and line-break support to style block (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrishikesh-k committed Feb 22, 2022
1 parent ebb6273 commit c5c02af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cli/index.ts
Expand Up @@ -214,7 +214,7 @@ function attributify(files: string[]) {
function styleBlock(files: string[]) {
files.forEach((file) => {
const content = readFileSync(file).toString();
const block = content.match(/(?<=<style lang=['"]windi["']>)[\s\S]*(?=<\/style>)/);
const block = content.match(/(?<=<style[\r\n]*\s*lang\s?=\s?['"]windi["']>)[\s\S]*(?=<\/style>)/);
if (block && block.index) {
const css = content.slice(block.index, block.index + block[0].length);
const parser = new CSSParser(css, processor);
Expand Down

0 comments on commit c5c02af

Please sign in to comment.