Giter Site home page Giter Site logo

Support HAML 5 about haml_user_tags HOT 3 OPEN

cgamesplay avatar cgamesplay commented on September 18, 2024
Support HAML 5

from haml_user_tags.

Comments (3)

CGamesPlay avatar CGamesPlay commented on September 18, 2024

Hey, if you can check that it's working with this version of haml, then absolutely! Thank you! 🙂

from haml_user_tags.

joshed-io avatar joshed-io commented on September 18, 2024

Love the idea behind this library. I gave it a shot with haml >= 5 and no dice unfortunately.

My hunch is that HAML changed some internals around between 4 and 5 - this line of haml_user_tags raises an exception because attributes_hashes doesn't exist on the tag value anymore.

I may investigate further and see if that'd be easy to fix, but just dropping here for anyone who comes across.

from haml_user_tags.

Valcrist77 avatar Valcrist77 commented on September 18, 2024

To get this working in our environment using Haml 5, there's two bits we've changed.

  1. [:attribute_hashes] is instead [:dynamic_attributes].old. The other wrinkle is that it looks like the previous format would look like this: [" flavor: 'solid', style: \"color: #888888;\" "], the new format being returned by the node looks like "{ flavor: 'solid', style: \"color: #888888;\ }" instead. So you'll need to manipulate the string a bit.
  2. Changing Haml::Buffer.merge_attrs in helpers.rb to Haml::AttributeBuilder.merge_attributes!. parse_object_ref has also moved into the Haml::AttributeBuilder module.

I've only done a cursory smoke test, so ymmv.

from haml_user_tags.

Related Issues (4)

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.