User:DemonDays64/Scripts/Dumb quotes

From WikiProjectMed
Jump to navigation Jump to search

Dumb quotes.js replaces smart curly single and double quotes with "dumb" quotes, to fit with MOS:Smart quotes.

Import by adding

{{subst:iusc|User:DemonDays64/Scripts/Dumb quotes.js}}

to your common.js page.

When you have this script loaded, a link in the Tools sidebar titled "Dumb quotes" will appear; clicking on it will replace every instance of a double or single curly quote with a straight quote. Example:

I have a dream, said King from DCs Lincoln Memorial.

becomes

"I have a dream," said King from DC's Lincoln Memorial.

This works in both the source and visual editors on desktop. It does not work on (at least the default skin's) mobile web view, but if you really need it on mobile, it works fine in desktop view which you can switch to at the bottom of the page.

Note that since August 2023 this script uses Regex lookbehinds to avoid modifying file links. This Regex feature has been supported for a few years (since 2017 or 2020) in all modern (i.e. not IE) browsers except Safari, where it was added in March 2023. If you are not using a new enough version of Safari, please update your browser to ensure the script functions properly.

Share and enjoy!