This is a migrated thread and some comments may be shown as answers.

Copy Bulleted list from word to Editor

1 Answer 35 Views
Editor
This is a migrated thread and some comments may be shown as answers.
suresh
Top achievements
Rank 1
suresh asked on 03 May 2014, 12:42 PM
Hi,

I am copying the bulleted list from word to editor. Also I have few more code to strip the html in the paste event of the editor.

paste: function (e) {
                                        e.html = CleanWordHTML(e.html);
                }
 
function CleanWordHTML(str) {
    str = str.replace(/<br><br>/g, "");
    str = str.replace(/<br> /g, " ");
    str = str.replace(/<br>/g, " ");
    str = str.replace(/<o:p>\s*<\/o:p>/g, "");
    str = str.replace(/<o:p>.*?<\/o:p>/g, " ");
    str = str.replace(/(<(?!\/)[^>]+>)+(<\/[^>]+>)+/gi, '');
    str = str.replace(/<span[^>]*>[\s| ]*<\/span>/, '');
    str = str.replace(/\s*class="MsoNormal"/gi, '');
    str = str.replace(/<SPAN\s*[^>]*>\s* \s*<\/SPAN>/gi, '');
    str = str.replace(/<SPAN\s*[^>]*><\/SPAN>/gi, '');
    str = str.replace(/<span\s*[^>]*>\s* \s*<\/span>/gi, '');
    str = str.replace(/<span\s*[^>]*><\/span>/gi, '');
    str = str.replace(/\s*mso-[^:]+:[^;"]+;?/gi, "");
return str;
}


After pasting into the editor, when I see the source code, bulleted list is coming as paragraph instead of ul, li tag.

Is there anyway to convert word bulleted list to html bulleted list?

Suresh. 

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 05 May 2014, 07:51 AM
Hello Suresh,

Can you reproduce the problem in the online demos, or is it specific for your solution? If you can reproduce it, please provide a Word document so that we can integrate it in our cleaning algorithm. If the problem is not reproducible, consider changing the custom cleaning code. Keep in mind that content pasted from Word reports lists as paragraphs.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Editor
Asked by
suresh
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or