machty / emblem.js

Emblem.js - Ember-friendly, indented syntax alternative for Handlebars.js
http://emblemjs.com
MIT License
1.04k stars 81 forks source link

Syntax error with "pattern" element #177

Closed typeoneerror closed 5 years ago

typeoneerror commented 10 years ago

Experienced this curious bug today (not sure if I'm just mis-using emblem or not...

input value=name class="form-control input-lg" autocomplete="off" placeholder="e.g. Digital Strategy for Designers" tabindex="1" required="required" pattern="[A-Z]{3}"

The above works great. When I use the optional "=" in front though:

= input value=name class="form-control input-lg" autocomplete="off" placeholder="e.g. Digital Strategy for Designers" tabindex="1" required="required" pattern="[A-Z]{3}"

This produces a crash:

. Compiler said: Error: Emblem syntax error, line 3: Expected BeginStatement or DEDENT but "\uEFEF" found.

Removing the "pattern" attribute but keeping the "=" solves the crash.

coladarci commented 10 years ago

As an FYI, I think there's a general issue with {} inside an attribute. I'd be curious if your regex didn't contain {3} if it'd still explode..