Loading...
 
Skip to main content

Features / Usability


Re: Plugin Edit removes line breaks in FancyTable

I am having the same problem in Tiki 6.3

One workaround I found is to put 
 at the end of each line. This is the html code for a line feed character. Unfortunately, you have to do this to each line every time you edit the table.

Took me all day, but I finally figured out a fix. it basically automates the workaround I mentioned previously.

Again, this is in Tiki 6.3, but I would venture to guess that this would work in other versions as well.

Line 759 of tiki-jquery.js should look like this:

Copy to clipboard
var blob = '{' + type.toUpperCase() + '(' + params.join(',') + ')}' + (typeof form.content !== 'undefined' ? form.content.value : '') + '{' + type.toUpperCase() + '}';


Add the following code directly above it:

Copy to clipboard
//workaroround for ckEditor if ((typeof form.content !== 'undefined') && (typeof CKEDITOR != 'undefined')) { form.content.value = form.content.value.replace(/(\r\n|[\r\n])/g,'~38~#10;'); } //end workaround
Thanks, mycroft. I'll give that a go.

Yes, that workaround worked for me to (putting at the end of each line).

Unfortunatley, if you have more than one table on the same page you're stuck - as editing one (with the workaround) will mess up the other when you "insert".

Hi mycroft,

I implemented your workaround in above 759 of tiki-jquery.js.

It worked 😀 except I getthe same problem as with the manual workaround:

If you have two or more fancy tables on the same page, when you edit one (which works fine now), the other messes up. Try and edit that one it'll fix it but them the first one messes up again 🙁

I feel silly that none of us have bothered to mention which web browser we are using. The first patch that I posted seems to work in Firefox 4 and Chrome. I have since seen an additional problem in IE. I have not got this working in IE 7 yet but I have had luck in IE 8 (IE 8 runs in IE7 compatibility mode by default, I believe - I had to manually switch it to IE 8 mode in the debug tools).

So, to get to the point, there is another bug I found that only affects IE.


Line 208 in lib\ckeditor_tiki\plugins\tikiplugin\plugin.js

Change:

Copy to clipboard
ret = $("").html(ret).text(); // decode html entities


To:

Copy to clipboard
return arguments[1];


The Element.innerHTML() function has a know problem of stripping linefeed characters in IE. This function is called in the jQuery .html call above. It turns out that we don't need to decode the html here as ckEditor seems to take care of it somewhere else.