Giter VIP home page Giter VIP logo

Comments (3)

thibaudcolas avatar thibaudcolas commented on July 18, 2024

Hey @bazzadp, thanks for the report. I wouldn’t be surprised if the parser was overly strict in that respect, having had to fix issues with it failing to parse self-closing SVG tags (#4), or uppercase HTML tags.

If you’re keen to look into this I think the fix would likely be to allow whitespace for all of the cases in

return (
style
| script
| void_element
| svg_self_closing_element
| container_element
)
.

Looking at the potential implementation, there might be a fair bit of duplication, since parsing for all of those different types of tags is separated out.

In the meantime, it might help to set Prettier to htmlWhitespaceSensitivity: ignore. I’d also happily accept a PR to document this issue on the website (perhaps a new "Known issues" page either at the end of the "Introduction" section, or under "References").


Can I ask what language or Prettier plugin you’re using for your templates? I think I ran into this issue before but didn’t really make much of it since Prettier doesn’t support the template syntax of Jinja / Django Templates I most commonly work with.

from curlylint.

thibaudcolas avatar thibaudcolas commented on July 18, 2024

Finally spending time to look into this further, the issue is here:

P.string("</").then(tag_name_parser).skip(P.string(">"))

This assumes the tag name on closing tags is directly followed with >. I think the fix could be as simple as:

-P.string("</").then(tag_name_parser).skip(P.string(">")) 
+P.string("</").then(tag_name_parser).skip(whitespace + P.string(">")) 

However I’m a bit hesitant to make parser changes like this until there is a better test suite in place. Any help towards this would be much appreciated!

from curlylint.

riodw avatar riodw commented on July 18, 2024

Upvote for this from me.

Is there a way to tell curly to ignore these types of errors in the meantime?

  • 220:12 Parse error: expected one of '>', 'attribute', '{#', '{%', '{{' at 220:12 parse_error

from curlylint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.