Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

\r\n characters with CKeditor


al3ks

Recommended Posts

Tried looking all over the net about this.

 

Does anyone else have this issue with ckeditor when editing product descriptions? After saving and editing again it creates "\r\n" characters on the beginning of each line. For some reason it only does it in product description, as I use the product specifications addon in other tabs it works ok.

 

I'm using the latest version (3.6.4) on oscommerce 2.3.2

Addon: http://addons.oscommerce.com/info/7650

 

Does anyone know how to fix this issue?

Find this post helpful? Click the 'Like this' button. :)

Link to comment
Share on other sites

@@al3ks

 

There is an instruction given in the contribution itself, please do follow:

 

If CKEditor is showing the HTML code when you go to edit text that has already been formatted, make the following change to the html_output.php file in the admin/functions directory.

 

Find:

} elseif (tep_not_null($text)) {

$field .= tep_output_string_protected($text);

}

 

Replace with:

 

} elseif (tep_not_null($text)) {

$field .= $text;

}

Like post..hit LIKE button.

 

osCommerce | Joomla | WordPress | Magento | SEO | CakePHP | CI

 

Guaranteed Website Speed Optimization!!

Link to comment
Share on other sites

I've seen this happen when pasting previously-formatted text into the box on a Windows computer, and the server is Linux. Windows uses \r\n as the newline characters, and ckeditor doesn't recognize this since its newline character is \n, so it outputs the characters instead of ignoring them as it does a proper newline.

 

Products Specifications does a lot of filtering on the descriptions field (to fix some bad HTML before it breaks the tabs) so it should be possible to filter this out. Not the best solution, but it should work. You can also delete the spurious characters and they won't come back.

 

The easiest solution would be to run Linux on the machine you use to maintain your site.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I've seen this happen when pasting previously-formatted text into the box on a Windows computer, and the server is Linux. Windows uses \r\n as the newline characters, and ckeditor doesn't recognize this since its newline character is \n, so it outputs the characters instead of ignoring them as it does a proper newline.

 

Products Specifications does a lot of filtering on the descriptions field (to fix some bad HTML before it breaks the tabs) so it should be possible to filter this out. Not the best solution, but it should work. You can also delete the spurious characters and they won't come back.

 

The easiest solution would be to run Linux on the machine you use to maintain your site.

 

Regards

Jim

 

Yeah the first time I thought it was because of pasting from Microsoft Word, but then I tried typing text directly into ckeditor and still the same.

 

In product specifications, what to I need to do to filter this out? I haven't modified the tabs apart from styling so I guess it doesn't do it by default.

Also it is strange that it only does this to the products description, other text areas in the tabs work all fine.

 

I have tried deleting them but they do appear the next time I edit the product.

Find this post helpful? Click the 'Like this' button. :)

Link to comment
Share on other sites

That's different. The site where I saw this would allow me to delete the extra characters.

 

I would have to experiment with the code to come up with a filter. It would probably be best to do it in the top of admin/categories.php, where the data is prepared for storage in the database. I'll take a look when I have the time.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 1 month later...

Hi everyone,

 

Is there any solution coming out?

 

 

(Hi Jim it is Lyn again..)

 

I am having the same problem (I also have Products Specifications installed) and got angry from my hubby boss....

Everytime he change the product picture or other Tabs, the description Tab just goes crazy. lots of r\\n\\,

 

I need to solve this very quick, (hopefully!) spend time to google and this is the only one really about the problem.

 

I am not familiar with Linux and all our computer is Window base, so it will be difficult to change to Linux.

Any other way to do it?

 

Thank you very much in advance.

 

Lyn

Link to comment
Share on other sites

  • 5 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...