This user script adds a button when editing Stack Exchange sites that automatically fixes many common grammar, spelling, capitalization, and usage errors.
- Install a user script extension (such as Tampermonkey) for your browser. Greasy Fork maintains a list of user script extensions that are available for various browsers.
- Click here to install
editor.user.js
within your user script manager.
- Edit a post or a comment on a Stack Exchange site.
- Click the Auto Editor button that appears in the toolbar for posts or below comments.
- The edit area will flash green if edits were automatically made, red if no edits were needed.
- Click the same button again to get a report of what changed, see diffs, and view the status of the unit tests.
- Submit the edits to Stack Exchange after making other manual edits as desired.
This script performs the following actions automatically:
- Corrects commonly misspelled words such as "untill" → "until"
- Capitalizes commonly used technologies names and acronyms such as "javascript" → "JavaScript"
- Fixes contractions with a missing apostrophe such as such as "dont" → "don't"
- Ensures the title starts with a capital letter but is not all caps.
- Removes niceties such as "hello", "thanks", and "please help"
- Removes "Edit:"
- Code format HTML tags not allowed in markdown
- Replaces domain names like "mydomain", "abc" or "foo" that have a real top level domain with officially approved example domains like
example.com
. When multiple different example domains are used, the replacements will use the.example
top level domain which is also reserved for example usage. - Applies code formatting to example URLs and file names
To minimize false-auto-corrections, these rules are markdown-aware. For example, spelling corrections are not applied inside code blocks or URLs. Each rule has a list of places where it should be applied.
The rules are coded into the source code for the script. To change the rules, you would need to edit it.