Summernote content coming with html tags
Asked Answered
S

5

7

I am new to summernote text editor. I am trying to get the proper content from the summernote textarea, which infact coming with html tags. I tried

    <textarea class="summernote" id="summernote"  ng-model="blog.content" ></textarea>

in my html page and getting the textarea content with,

     $("#summernote").code();

it is fetching the content in html tags. I want the content to be displayed without the html tags.

Thank you for the advice.

Siskin answered 27/3, 2015 at 14:32 Comment(0)
S
1

After a long time of searching , thought instead of trying that in getting summernote text editor value with plain text, why not try with the angular filter. So searched and got the filter which exactly does what I needed.

Here is the link which did my job.

angularjs to output plain text instead of html

Siskin answered 27/3, 2015 at 16:20 Comment(0)
S
3

Use val() to get all what entered in textarea or text, So :

var content = $("#summernote").val()
Superlative answered 27/3, 2015 at 14:36 Comment(2)
You can use a fade actionSuperlative
for 10 millisecond then use thisSuperlative
N
3

in laravel, simple use

{!! $product->small_description !!} 

instread of {{! $product->small_description !}}

in blade file where you want to fetch the data

Naamann answered 18/5, 2021 at 4:2 Comment(0)
A
2

Use $().text() method to get plain text.

$("<div />").html($("#summernote").code()).text();
Abib answered 1/4, 2015 at 5:29 Comment(0)
S
1

After a long time of searching , thought instead of trying that in getting summernote text editor value with plain text, why not try with the angular filter. So searched and got the filter which exactly does what I needed.

Here is the link which did my job.

angularjs to output plain text instead of html

Siskin answered 27/3, 2015 at 16:20 Comment(0)
H
1

I had the same problem, "fixed" it by using version 0.6.16 instead of the current stable version 0.7. HTML is rendering fine now without extra js code.

Hazard answered 5/12, 2015 at 15:44 Comment(1)
Oh thank you! This fixed my issue! I've been tearing my hair for about an hour.Berthaberthe

© 2022 - 2024 — McMap. All rights reserved.