Wikipedia:AutoEd/htmltowikitext.js: Difference between revisions

Content deleted Content added
Per request on talk
Fixes
 
Line 2:
function autoEdHTMLtoWikitext(str) {
// <b> and <i> tags
str = str.replace(/<B[ ]*>((?:[^<>]|<[a-z][^<>]*\/>|<([a-z]+)(?:| [^<>]*)>[^<>]*<\/\32>)*?)<\/\1B[ ]*>/gi, "'''$1'''");
str = str.replace(/<I[ ]*>((?:[^<>]|<[a-z][^<>]*\/>|<([a-z]+)(?:| [^<>]*)>[^<>]*<\/\32>)*?)<\/\1I[ ]*>/gi, "''$1''");
// </br>, <\br>, <br\>, <BR />, ...
str = str.replace(/<[\\\/]+BR[\\\/\s]*>/gim, '<br />');