4

About

This user script adds a button when editing Stack Exchange sites that automatically fixes many common grammar, spelling, capitalization, and usage errors.

Installation

  1. 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.
  2. Click here to install editor.user.js within your user script manager.

Usage

  1. Edit a post or a comment on a Stack Exchange site.
  2. Click the Auto Editor button that appears in the toolbar for posts or below comments.
  3. The edit area will flash green if edits were automatically made, red if no edits were needed.
  4. Click the same button again to get a report of what changed, see diffs, and view the status of the unit tests.
  5. Submit the edits to Stack Exchange after making other manual edits as desired.

⚠️ This tool sometimes suggests edits that make posts worse. You are responsible for manually reviewing all edits. Auto-edit rules are created from heuristics and regular expressions and they are not infallible. This tool is designed to save you effort by doing the right thing 90% of time. Bad auto-edits will need to be manually fixed or abandoned. All edits will have your name attached to them, so you don't want to blindly trust this tool.

Rules

This script performs the following actions automatically:

  • Expands some acronyms such as "SO" and "SE"
  • 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:"
  • 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.

History

This is a working, rewritten, and much improved fork of AstroCB's Stack Exchange Editor Toolkit which in turn was a replacement for the defunct SE Editor Toolkit.

2 Answers 2

1

capital, principal, windows, grate are all valid words that shouldn't be auto-replaced.

filenames are being reformatted within codeblocks (eg. https://stackoverflow.com/q/72766170, https://unix.stackexchange.com/posts/664993/edit)

5
  • "capital", "principal", "grate" -- agreed, will be removed. Commented Jun 27, 2022 at 8:52
  • "Windows" has long been a rule in the editor toolkit. I'm on the fence about it. The vast majority of the time usage of the word on Stack Exchange has to do with Microsoft Windows. Commented Jun 27, 2022 at 8:54
  • Filenames within codeblocks: There is a bug in my markdown parser. Specifically, the three backticks around the inline code in the first paragraph are throwing it off. I'll look into it. Commented Jun 27, 2022 at 8:56
  • I'm onboard with removing "Windows" from the auto-correction list as well. It would still be able to auto-correct "Windows XP" and "Windows 10" but it would leave "broken windows" alone. Commented Jun 27, 2022 at 20:25
  • Version 1.0.11 fixes all these issues. Commented Jun 27, 2022 at 21:46
0

The script doesn't work on non-inline editors, ie. https://stackapps.com/posts/9440/edit

Clicking the button throws this error:

devtools

4
  • 1
    Please try version 1.0.10. I made some significant changes to the way it detects fields in various editor configurations. Commented Jun 27, 2022 at 0:27
  • 1
    @StephenOstermiller It's also missing in the new answer box. Commented Jun 27, 2022 at 4:25
  • 1
    Yes, I just add the "re-run" functionality to it, so it would be much more useful there now. Commented Jun 27, 2022 at 8:57
  • Added to the new answer box in version 1.0.11 Commented Jun 27, 2022 at 21:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .