Summernote html tag content

I am new to summernote text editor. I am trying to get the correct content from summernote textarea that appears using html tags. I tried

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

on my html page and getting the textarea content with

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

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

Thanks for the advice.

+4
source share
4 answers

After a long search, think, instead of trying to use the value of the opennote summernote text editor, why not try with the angular filter. So I searched and got a filter that definitely does what I need.

, .

angularjs html

+1

$(). text() .

$("<div />").html($("#summernote").code()).text();
+2

Use val () to get everything that was entered in textarea or text, So:

var content = $("#summernote").val()
+1
source

I had the same problem, “fixed” it using version 0.6.16 instead of the current stable version 0.7. HTML is now perfectly processed without additional js code.

+1
source

All Articles