User:Novem Linguae/Scripts/DraftCleaner.js: Difference between revisions

Content deleted Content added
fix edge cases in deleteDuplicateReferencesSection() (publish.php)
fix crash in deleteDuplicateReferencesSection() (publish.php)
Line 11:
- put <ref>s after periods
- clean external links out of the main article area (turn them into references)
- add ==References== section
 
- More detailed list of uses:
Line 654 ⟶ 655:
deleteDuplicateReferencesSection(wikicode) {
let matches = wikicode.match(/== ?References ?==/gi);
if ( matches !== null && matches.length > 1 ) {
// run regexes that are likely to delete the extra section
let attempt = wikicode.replace(