Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Commit

Permalink
adding a new cleanup rule
Browse files Browse the repository at this point in the history
  • Loading branch information
wikipedia-mabdul committed Oct 7, 2013
1 parent 67a253a commit 2ad25e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/submissions.js
Expand Up @@ -1157,6 +1157,8 @@ function afcHelper_cleanup(text,type) {
text = text.replace(/\s*(<\s*ref\s*(name\s*=|group\s*=)*\s*.*[^\/]+>)[ \t]*$/gim, "$1");
//Ref tag correction part #2: move :;.,!? before ref tags
text = text.replace(/\s*((<\s*ref\s*(name\s*=|group\s*=)*\s*.*[\/]{1}>)|(<\s*ref\s*(name\s*=|group\s*=)*\s*[^\/]*>(?:\\<[^\<\>]*\>|[^><])*\<\/\s*ref\s*\>))[ \t]*([.!?,;:])+$/gim, "$6$1");
//Link / Template correction: replace {{http://example.com/foobar}} with "* http://example.com/foo" (common error by new users)
text = text.replace(/\n\{\{(http[s]?|ftp[s]?|irc|gopher|telnet)\:\/\/(.*?)\}\}/gi, "\n\* $1:\/\/$3");

// Remove all unneeded HTML comments and wizards stuff
text = text.replace("\* \[http\:\/\/www.example.com\/ example.com\]", "");
Expand Down

0 comments on commit 2ad25e2

Please sign in to comment.