Forum closed. New forum available at http://community.wymeditor.org/

paragraph tags

Support forum for WYMeditor.

paragraph tags

Postby frogfood on Tue Dec 26, 2006 6:15 pm

How can I preserve lists? Everytime I paste text with lists in them the lists are stripped and are just divided by breaks. I've commented out and played around with the li and ul code in util.js. Now, when I do that I do get a list but all the paragraph tags are removed and replaced with breaks.

Any help would be most appreciated. :)

edit : Just to add, this only occurs in IE6. Firefox works fine but it isn't an option with our CMS.
frogfood
 
Posts: 1
Joined: Tue Dec 26, 2006 6:06 pm

Postby jfh on Thu Dec 28, 2006 9:06 pm

I suppose you paste from another app or another window, so paste cleanup is on.
If this is your case, you should see pasteData() in wym.js.
Actually this function takes the raw text, so removes all the markup.
This is the only 'easy' option, because it's extremely difficult to handle the ugly code coming from Word or other apps.

The line sTmp=sTmp.replace(/\r\n/g,"<br />"); replaces newlines by a br tag.
If your list elements begin with some special character, you can easily find them, take the line's text and put <li>text</li> in sTmp for each list element.

Another option is disabling the paste cleanup by simply removing onbeforepaste and onpaste in editor.htm.

HTH,
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest