开发者

Remove bullets from the Clipboard data while copying from Word

开发者 https://www.devze.com 2023-03-14 13:08 出处:网络
Hi i have a requirement t开发者_如何学Co remove bullets while copying from MS Word. I have some code to replace them with list tag in HTML.

Hi i have a requirement t开发者_如何学Co remove bullets while copying from MS Word.

I have some code to replace them with list tag in HTML. But i want to remove instead of replacing them with lists.

Please someone help me, Below is my code But it is not Javascript code.I need it in Javascript

 Find and Replace '•\t.+', '<li>\0</li>', 'EaW'
 Find and Replace '•\t', '', 'EaW'
 Find and Replace '</li>(?=(?:.|\n)([^<]+)|\z|(?:.|\n)\z)', '</li></ul>', 'EaW'
 Find and Replace '(?<!</li>\n)<li>', '<ul>\0', 'EaW'

Thank you


This is a simple example of what you are trying to do. I leave it to you to write the rest and make sure it works.

var bullettedText = "•  asdf";
var html = bullettedText.replace(/•\t/g, '<li>');
alert(html);

This one replaces all matches of •\t in the text with <li>.

0

精彩评论

暂无评论...
验证码 换一张
取 消