List of DraftCleaner features
````
- converts [inline external links] to s
- reduces more than 2 enters in a row, to 2 enters
- removes spaces in front of s
- get rid of any level 2 heading that contains the article's title
- bold the first occurrence of the article title
- remove bold from headings
- convert =TitleHeading= to ==H2Heading==
- replace Covid-19 with COVID-19
- remove enter characters between s
- trim whitespace at beginning and end
- remove self wikilinks to the article title
- convert ==Reference== to ==References==
- swap ref period with period ref
- turn bare URLs into references
- fix errant spaces at beginning of lines, which makes a blockquote looking thing
- add references section if missing
- delete whitespace at the end of lines
- convert smart quotes to regular quotes
- convert double spaces to single spaces
- remove blank heading
- in refs, turn short links into long links, so you can see the domain
- change year range dash to ndash
- if in draftspace, and draft in categories, disable the categories
- delete . in drafts, these are usually poorly placed
- fix empty references section
- right align images
- remove whitespace if that is the only character on a line
- correct capitalization of see also, references, further reading, external links
- if article has headings but no lead, remove first heading
- replace unicode bullets with asterisks
````
@enterprisey suggested that DraftCleaner be merged into AFCH here, and I am open to it. I'd like to use this ticket to gauge consensus for this and to discuss implementation details.
DraftCleaner has too many false positives at the moment, but this could be easily fixed if I turned off the 2 patterns that cause the most false positives.
I can write a bunch of unit tests for this, if needed. This kind of code would be easy to unit test. A bunch of string in, string out functions.
What is the best way to integrate? Leave it as a script in my userspace and (after some refactoring) have AFCH load it? Or bring the code into this repo?
What exactly does the existing "Clean Submission" button do? What unique features does it have? What overlap with DraftCleaner does it have?
Novem Linguae's DraftCleaner is a user script that cleans up drafts by running regex's on its wikitext.
List of DraftCleaner features
```` - converts [inline external links] to s - reduces more than 2 enters in a row, to 2 enters - removes spaces in front of s - get rid of any level 2 heading that contains the article's title - bold the first occurrence of the article title - remove bold from headings - convert =TitleHeading= to ==H2Heading== - replace Covid-19 with COVID-19 - remove enter characters between s - trim whitespace at beginning and end - remove self wikilinks to the article title - convert ==Reference== to ==References== - swap ref period with period ref - turn bare URLs into references - fix errant spaces at beginning of lines, which makes a blockquote looking thing - add references section if missing - delete whitespace at the end of lines - convert smart quotes to regular quotes - convert double spaces to single spaces - remove blank heading - in refs, turn short links into long links, so you can see the domain - change year range dash to ndash - if in draftspace, and draft in categories, disable the categories - delete. in drafts, these are usually poorly placed - fix empty references section - right align images - remove whitespace if that is the only character on a line - correct capitalization of see also, references, further reading, external links - if article has headings but no lead, remove first heading - replace unicode bullets with asterisks ````
@enterprisey suggested that DraftCleaner be merged into AFCH here, and I am open to it. I'd like to use this ticket to gauge consensus for this and to discuss implementation details.