antonmedv / monkberry

Monkberry is a JavaScript library for building web user interfaces
https://monkberry.js.org
MIT License
1.49k stars 78 forks source link

Multi-line comment parsing error #51

Closed Abdillah closed 5 years ago

Abdillah commented 6 years ago

How to reproduce?

  1. Create a .monk file with comment that span lines,

    <!-- <option value="" disabled="" selected="">Select a Value</option>
    <option value="1">First value</option> -->
  2. Require it from javascript using webpack plugin with monkberry-loader

  3. Compile, got me into the following error,

[1] ERROR in ./src/componentA/view.monk
[1] (Emitted value instead of an instance of Error) Parse error on line 14:
[1] ...ect a Value</option>                  <
[1] -----------------------^
[1] Expecting '-->', got 'COMMENT'
[1]  @ ./src/componentA/index.js 13:12-34
[1]  @ ./src/main.js

What to expect?

A valid multi line comment, that hopefully cover commenting monkberry template syntax too, like <!-- {% if (true) %} -->.

Toolkit Version

monkberry-loader v4.0.8
monkberry v4.0.8
webpack v3.8.1
node v9.3.0
antonmedv commented 6 years ago

Looks like a bug. Multiline commends doesn't working.