trivago / melody

Melody is a library for building JavaScript web applications.
https://melody.js.org
Apache License 2.0
215 stars 39 forks source link

Add parsing of declarations like <!DOCTYPE html> #150

Closed twbartel closed 4 years ago

twbartel commented 4 years ago

Previously, melody-parser would go into an endless loop when encountering a declaration like <!DOCTYPE html>. This PR fixes that by introducing a new Declaration node type. By default, these nodes are not added to the AST. They are only added if the new Parser option ignoreDeclarations is set to false.