maud icon indicating copy to clipboard operation
maud copied to clipboard

Improve error message for classes and IDs containing numbers

Open lambda-fairy opened this issue 4 years ago • 0 comments

Follow-up to #208.

This code:

html! {
    div.col-sm-2 {}
}

leads to this error:

error: literal must be double-quoted: `"2"`
  --> $DIR/non-string-literal.rs:15:20
   |
15 |         div.col-sm-2 {}
   |                    ^

error: element body must be wrapped in braces
  --> $DIR/non-string-literal.rs:15:20
   |
15 |         div.col-sm-2 {}
   |                    ^
   |
   = help: see https://github.com/lambda-fairy/maud/pull/137 for details

Ideally it should say something like this:

error: classes with special characters must be double-quoted: `."col-sm-2"`
  --> $DIR/non-string-literal.rs:15:20
   |
15 |         div.col-sm-2 {}
   |                    ^

lambda-fairy avatar Mar 21 '21 11:03 lambda-fairy