Table creates borders that won't go away
picturesque - June 8, 2009 - 20:09
| Project: | OpenWYSIWYG Editor |
| Version: | 6.x-1.0-beta3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I'll created a table, specify no border. When I save and edit and save again, the border is now set to 1 px dashed. If I delete the offending HTML code, it puts the border back in ignoring my deletes. I've tried setting it to 0px and it sets it back to 1px. Ditto for any other edit to try to hide the border like a color change. It just keeps resetting it back to some default coming from who knows where. How do I get this to stop?

#1
I confirm this is a bug and I will try to fix this in next release.
The workaround right now is:
- avoid to use Full HTML, mean you can select "Filtered HTML" then add these tags:
<table> <th> <tr> <td>#2
This won't be a solution as we need tables. I need to display content in two columns.
#3
I've started using FCKeditor and IMCE instead. If this module is ever fixed, I'm willing to try it again.
#4
I'd like to say that I've patched this issue in my version of OpenWYSIWYG. This too annoyed the crap out of me because the system is great and I'm made tons of mods and made my own add-ons to make my CMS the best out there. I have just always had this issue. To resolve this problem, open wysiwyg.js, scroll to about line 1650. You should see the function updateTextArea: function(n){. Look through the commands inside that function and add this before and after the line that reads var content = this.getEditorWindow(n).document.body.innerHTML;
WYSIWYG_Table.disableHighlighting(n); <- This goes before
WYSIWYG_Table.refreshHighlighting(n); <- This goes after
When done, the section should look like it does below.
updateTextArea: function(n) {// on update switch editor back to html mode
if(this.viewTextMode[n]) { this.viewText(n); }
// Disable WYSIWYG table styles
WYSIWYG_Table.disableHighlighting(n);
// get inner HTML
var content = this.getEditorWindow(n).document.body.innerHTML;
// Renenable WYSIWYG table styles
WYSIWYG_Table.refreshHighlighting(n);
// strip off defined URLs on IE
content = this.stripURLPath(n, content);
// replace all decimal color strings with hex color strings
content = WYSIWYG_Core.replaceRGBWithHexColor(content);
// remove line breaks before content will be updated
//if(this.config[n].ReplaceLineBreaks) { content = content.replace(/(\r\n)|(\n)/ig, ""); }
// set content back in textarea
$(n).value = content;
},
Any other questions or comments, E-Mail me back at dmoree[AT]shadowbranch(DOT)com
#5
I think I found the script you are referring to in modules/openwysiwyg/library/scripts/openwysiwyg.modified.js
Here is my cut/paste after editing (in case I did a typo), but it didn't work.
updateTextArea: function(n) {
// on update switch editor back to html mode
if(this.viewTextMode[n]) { this.viewText(n); }
// Disable WYSIWYG table styles
WYSIWYG_Table.disableHighlighting(n);
// get inner HTML
var content = this.getEditorWindow(n).document.body.innerHTML;
// Renenable WYSIWYG table styles
WYSIWYG_Table.refreshHighlighting(n);
// strip off defined URLs on IE
content = this.stripURLPath(n, content);
// replace all decimal color strings with hex color strings
content = WYSIWYG_Core.replaceRGBWithHexColor(content);
// remove line breaks before content will be updated
if(this.config[n].ReplaceLineBreaks) { content = content.replace(/(\r\n)|(\n)/ig, ""); }
// set content back in textarea
$_openwysiwyg(n).value = content;
},
#6
I tried using filtered HTML with the table tags included, but the bug seems to persist :(