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.
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.
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.