-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Model becomes empty after edit for some templates and with 'disableSanitizer = true' #1230
Comments
This is very interesting. I am looking at this with a number of fixes already in the code for the next release and will see if I can figure out why this is happening. |
This happens in Chrome and Firefox. Also if the html has one blank line at the start, all you need to do is toggle back and forth between the html and wysiwyg view. and MAGIC all the html is gone! When this happens, the taTextElement still contains the original html that is viewed in the wysiwyg mode and the NOTE: If I put a I am going to look at this a bit more... But if it isn't clear, I am going to cut the new release and then come back to this later. |
This looks difficult to fix. I will punt for today.... |
I took a long look at this again yesterday. The code in this whole area is relatively difficult to modify. It will take some time and perhaps this section of code needs a full redesign which will be difficult. One way in which you can see some of the issues, is to simply take your <table>....</table> example and add a 'a' character before the 'html' in the html view. When you switch to the WYSIWYG view your see the expected view, and it you view the underlying html using Chrome's Developer Tools and selected Elements and viewing the <input> element you will see this have become <p>a</p>...<table>...</table> as expected. BUT the 'html' view is still a<table>...</table> as before. YUCK If I can see a good way synchronize this with the <input> element it will get better. But the fact that it doesn't do that yet is why I believe a redesign of this area of the code is needed. How big of an issue is this for you at this point. Have you discovered any good work arounds? |
Thanks for your try! But it was really a bad day when I was trying to figure out what the heck is going on :) |
I have just about fixed this. I need to spend some time tomorrow making sure that my changes will not break the functionality that folks depend on related to trimming white space. |
I will finish this tomorrow. The issue is how best to keep the html and the ngModel in sync. And another day of thought makes sense. It now works, but one can get the html out of sync from the model and I would like to stop that. |
Fix(taBind): Corrected issue around model becomes empty Issue #1230
v1.5.3 fixes this... please check... |
Really good news, thanks! |
Fix works fine with provided plunkr but still doesn't work for my templates :( |
Looks like comments make the problem here. Maybe textAngular should clear comments from the model at the start? |
@JoelParke should I create new issue? |
Please test with v1.5.5 which should resolve this. I will close, and please re-open if this is still an issue! |
It works! |
For some html, if you edit the text, model becomes empty. But only with 'disableSanitizer = true'.
Here is an example of html:
'\n\n<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-spacing: 0px; border-collapse: collapse; padding: 0px; font-size: 12px; font-family: \'Helvetica Neue\', Helvetica, Arial, sans-serif; "><tr><td>xxx</td></tr></table>'
and plunker (try to edit the field in the first textarea, the second one works fine)
What helps to fix that in the sample template:
Looks really strange.
I have to disable sanitizer because I work with complex email-templates in text field. And these templates doesn't always work properly with sanitizer.
The text was updated successfully, but these errors were encountered: