Code Monkey home page Code Monkey logo

Comments (7)

nam-co avatar nam-co commented on June 12, 2024 1

Found it, I think, I just added *[style|class] to 'HTML.Allowed'

Seems to be working 👍

from purify.

stevebauman avatar stevebauman commented on June 12, 2024 1

I'm so glad you enjoy the package @nam-co! 😄

is there a way to change the config path?

You can do this by simply updating the purify.php config to contain a config() reference to another configuration file:

// config/purify.php

return [

    // ...

    'configs' => [
        'default' => config('my-package.purify.config'),
    ],

];

I hope this answers your question!

from purify.

stevebauman avatar stevebauman commented on June 12, 2024

Hi there @nam-co,

Thanks for updating this issue with your resolution! That is the correct way to add those attributes to the allowed HTML.

Marking this as complete 👍

from purify.

nam-co avatar nam-co commented on June 12, 2024

Thanks @stevebauman , question: the package is so good Im planing on using it on all my projects, is there a way to change the config path? this way I can use a general purify config file that will be included with a general package I use in all my projects, just an idea

from purify.

nam-co avatar nam-co commented on June 12, 2024

Steve I tried this, but it comes out as null, but if I dd(config('my-package.purify.text')); it shows the array ok, any ideas?
Sorry about all this questions

'configs' => [
  //default..
  'text' => config('my-package.purify.text'),
  'html' => config('my-package.purify.html')
]

from purify.

stevebauman avatar stevebauman commented on June 12, 2024

No worries @nam-co! I'm here to help 🙏

You're right -- you may have to set the configs at runtime. You can do so in your AppServiceProvider.

Can you give this a shot?

// app/Providers/AppServiceProvider.php

public function boot()
{
    config([
        'purify.configs' => [
            'text' => config('my-package.purify.text'),
            'html' => config('my-package.purify.html'),
        ]
    ]);
}

from purify.

nam-co avatar nam-co commented on June 12, 2024

it worked thanks, since I bet you know a lot more than I do, I need to ask, will this make the load a ms slower? I ask because I do a lot of service provider on my package

from purify.

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.