marko-js / htmljs-parser

An HTML parser recognizes content and string placeholders and allows JavaScript expressions as attribute values
MIT License
135 stars 20 forks source link

Backslash in style block causes parsing errors #167

Closed vwong closed 10 months ago

vwong commented 10 months ago

Version: 5.5.0

├─┬ @marko/run@0.2.12
│ └─┬ @marko/compiler@5.33.3
│   └── htmljs-parser@5.5.0
└─┬ @marko/type-check@1.0.2
  └─┬ @marko/language-tools@2.1.6
    └── htmljs-parser@5.5.0 deduped

Details

I'm trying to write single-file-components with view, behaviour and style in one file.

Expected Behavior

I should be able to put arbitrary valid CSS in the style block.

Actual Behavior

Most CSS is fine, but seemingly backslash seems to cause problems.

Steps to Reproduce

Insert the following into a Marko file.

style.scss {
  .foo {
    grid: "left right" / 3fr 7fr;
  }
}

Compiler fails with EOL reached while parsing regular expression

DylanPiercey commented 10 months ago

closed by #168