WYSIWYG HTML Editor returning unexpected results

I am using the tinymice WYSIWYG HTML Editor.

It seems to work fine on most things but is returning funky html when there are conditional statements in the html code

This is what is being loaded so as to use the HTML Editor...

It seems that The bad results are consistent with the editor stripping out the conditional comments that are used to handle the formatting in Outlook

            <%--WYSIWYG Editor Code--%>
    <script src="assets/js/jquery.min.js"></script>
    <script src="plugins/tinymce/tinymce.min.js"></script>
    <script>
        $(document).ready(function () {
            if ($("#ctl00_ContentPlaceHolder1_elm1").length > 0) {
                tinymce.init({
                    selector: "textarea#ctl00_ContentPlaceHolder1_elm1",
                    theme: "modern",
                    height: 300,
                    plugins: [
                        "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
                        "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
                        "save table contextmenu directionality emoticons template paste textcolor",
                        "fullpage"
                    ],
                    toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons",
                    style_formats: [
                        { title: 'Bold text', inline: 'b' },
                        { title: 'Red text', inline: 'span', styles: { color: '#ff0000' } },
                        { title: 'Red header', block: 'h1', styles: { color: '#ff0000' } },
                        { title: 'Example 1', inline: 'span', classes: 'example1' },
                        { title: 'Example 2', inline: 'span', classes: 'example2' },
                        { title: 'Table styles' },
                        { title: 'Table row 1', selector: 'tr', classes: 'tablerow1' }
                    ]
                });
            }
        });
    </script>

Open in new window

Larry Bristersr. DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lenamtlCommented:
Hi,

This seems related to your previous question.
My answer will be the same...
https://www.experts-exchange.com/questions/29084036/WYSIWYG-HTML-Editor.html#a42471636
Just add
entity_encoding : "raw",

Open in new window



 $(document).ready(function () {
            if ($("#ctl00_ContentPlaceHolder1_elm1").length > 0) {
                tinymce.init({
                    selector: "textarea#ctl00_ContentPlaceHolder1_elm1",
                    theme: "modern",
                    height: 300,
                   entity_encoding : "raw",
                    plugins: [
                        "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
                        "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
                        "save table contextmenu directionality emoticons template paste textcolor",
                        "fullpage"
                    ],
                    toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons",
                    style_formats: [
                        { title: 'Bold text', inline: 'b' },
                        { title: 'Red text', inline: 'span', styles: { color: '#ff0000' } },
                        { title: 'Red header', block: 'h1', styles: { color: '#ff0000' } },
                        { title: 'Example 1', inline: 'span', classes: 'example1' },
                        { title: 'Example 2', inline: 'span', classes: 'example2' },
                        { title: 'Table styles' },
                        { title: 'Table row 1', selector: 'tr', classes: 'tablerow1' }
                    ]
                });
            }
        });

Open in new window



You can for my codepen with your code
https://codepen.io/lenamtl/pen/BYwgez
0
Larry Bristersr. DeveloperAuthor Commented:
Hey lenmatyl
 That did not make any difference.
0
lenamtlCommented:
Do you have any error in Chrome console right click inspect?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Larry Bristersr. DeveloperAuthor Commented:
Hey lemantl
  When I run the page and it just loads there are some console errors that are unrelated... (SP1) below

However... when I activate the element on an ajax postback I see a 404 error but not sure how to tell if this relates? (SP2)

SP1
SP2
0
lenamtlCommented:
When you having an error this will break the code of other Javascript.

So you have to fix these errors.

First message is related to a value that cannot be NULL...

Second message a file or a page is not found, chance are good that both error are related as your code having a page request....
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Larry Bristersr. DeveloperAuthor Commented:
Fixing the errors helped ALMOST everything

New question posted
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.