6 months ago

How to allow blade to except (<a href>, <br /> ... etc)

Posted 6 months ago by nhayder

I have contenteditable div on my app, using vue im saving input of the user like this

// example
            <h1 v-html="widget.title" ref="wTitle"



// this is vue save function
            save: function(){

                let id = this.id;

                let text = this.$refs.wTitle.innerHTML;

                this.$store.dispatch('saveText', [id, text, 'title']);


the code above is not allowing me to save keyboard (enter, white space) in stead its returning html on the page

// something like this
[space bar click] [space bar click] this is my name [space bar click] [keyboard enter]
&nbsp; &nbsp;this is my name&nbsp; &nbsp;

and its stripping out tags, ...

i want blade to except specific html tags like , [space bar click]etc, ...

i'm NOT planning to use sanitization packages because most of the are not updated,

preferably i want to use laravel build it features to help out in rendering specific tags on the page.

Any Ideas ????

Please sign in or create an account to participate in this conversation.