Git Product home page Git Product logo

Comments (5)

daftspunk avatar daftspunk commented on May 29, 2024 1

As a side note, a new plugin (or this one) could be used to introduce the twig/intl-extra composer package (described above) and register its extension. That would be pretty cool.

To retrofit this one:

  1. Create a branch called 1.x for the current code, you can continue to maintain 1.x tags from this branch
  2. Update this plugin to offer the new features
  3. Require october/rain at >=3.1 like we have done with the translate plugin
  4. Publish the plugin as 2.0 (tag as v2.0.0)
  5. Set the supported version on the October CMS marketplace under "Compatibility" to protect v1 sites from getting the new version

I hope this helps!

from oc-twigextensions-plugin.

vojtasvoboda avatar vojtasvoboda commented on May 29, 2024 1

One more thing @daftspunk maybe related to html_mailto issue above:

{{ '<p><strong>Test</strong></p>'|html_strip('<p>')|raw }}

When using html_strip with specify allow tags, I have to use raw filter, otherwise, it renders HTML entities.

I've prepared and tested twig/intl-extra integration and the new plugin's version is almost done! :-) Just polishing readme etc.

from oc-twigextensions-plugin.

vojtasvoboda avatar vojtasvoboda commented on May 29, 2024

Thank @daftspunk for your help! I started to work on a new version/branch and have a few questions/notes (tested on OctoberCMS 3.1.17):

a) {{ "October CMS" | str_replace('CMS', 'ERP') }} returns ERP, not October ERP... looks like it works only like that: `{{ str_replace('CMS', 'ERP', 'October CMS') }}

b) arr_shuffle not works, nor the array_shuffle, nor the shuffle... it throws a "not existing filter" exception

c) {{ '[email protected]'|html_mailto|raw }} requires raw on the end, otherwise returns just HTML encoded version

from oc-twigextensions-plugin.

daftspunk avatar daftspunk commented on May 29, 2024

Thanks, @vojtasvoboda!

a) This is a bug, fixed in v3.1.18

b) Oops, I thought, arr_* proxied to \Arr::*. We should be using collect().shuffle() here anyway. Docs have been updated:

{{ collect(songs).shuffle() }}

c) Another bug, fixed in v3.1.18

from oc-twigextensions-plugin.

daftspunk avatar daftspunk commented on May 29, 2024

Ok, we can fix this in the next patch. It looks like all html_ functions and filters should not be escaped. It should be fixed in 3.1.19

Great work on the release!

from oc-twigextensions-plugin.

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.