tildeio / htmlbars

A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes
MIT License
1.61k stars 193 forks source link

Using a script tag should throw an error #427

Closed mmun closed 8 years ago

mmun commented 8 years ago

If anyone's up for it, here's what to do!

  1. Write a function validateStartTag and call it in finishStartTag: https://github.com/tildeio/htmlbars/blob/master/packages/htmlbars-syntax/lib/parser/tokenizer-event-handlers.js#L80-L86. It should look similar to the existing validation in finishEndTag: https://github.com/tildeio/htmlbars/blob/master/packages/htmlbars-syntax/lib/parser/tokenizer-event-handlers.js#L95.
  2. validateStartTag should throw if the tag name is script with a helpful error message (Explanation, line number, etc.)
  3. Write a test in https://github.com/tildeio/htmlbars/blob/master/packages/htmlbars-syntax/tests/parser-node-test.js.