angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 371 forks source link

Codesample plugin removes HTML code #236

Closed felipegtx closed 8 years ago

felipegtx commented 8 years ago

Since I'm not sure whether or not this is issue was caused by the angular plugin and I've already created an issue on the main tinymce repo, I think it's better to let you guys know about this.

I've used de codesample plugin to save some HTML code but when I'm trying to edit that information, tinyemce removes all the html code from there.

My code goes as follows:

$scope.tinymceOptions = {
            height: 400,
            inline: false,
            plugins: "textcolor colorpicker image link hr table fullscreen code codesample",
            menubar: false,
            default_link_target: "_blank",
            toolbar1: "alignleft aligncenter alignright alignjustify bold italic bullist numlist | forecolor backcolor styleselect fontselect fontsizeselect | hr",
            toolbar2: "undo redo removeformat | image link table codesample code | fullscreen"
        };

Edit: I'm using version 4.3.4 (2016-02-11)

felipegtx commented 8 years ago

Reopening according to instructions from a TinyMCE member here

deeg commented 8 years ago

@felipegtx thanks for following up with the TinyMCE team.

I will take a look into this and see if I can't find the issue.

Could you please add a plunker reproducing the issue?

felipegtx commented 8 years ago

Hey @deeg, thank you for your reply.

As I was working on the Plunker code I found out what the problem was. Turns out that I was asking my .Net code to write the raw contents into the textarea. That was messing up the blocks start/end data since it doesn't HtmlEncode the information.

That solved the problem for me :+1:

deeg commented 8 years ago

@felipegtx, glad everything is settled for you.

Would you mind letting them know on the TinyMCE ticket so everyone is on the same page, and for others who might run into the same issue and find that ticket?

felipegtx commented 8 years ago

Just did it. thank you once again @deeg.