_ _    _ _____  ___   __                       
 __      _(_) | _(_)___ / ( _ ) / /_   ___ ___  _ __ ___  
 \ \ /\ / / | |/ / | |_ \ / _ \| '_ \ / __/ _ \| '_ ` _ \ 
  \ V  V /| |   <| |___) | (_) | (_) | (_| (_) | | | | | |
   \_/\_/ |_|_|\_\_|____/ \___/ \___(_)___\___/|_| |_| |_|

User:Omegatron/monobook.js/dashfixer.js

In today's world, User:Omegatron/monobook.js/dashfixer.js plays a fundamental role in our society. Whether in politics, economics, culture or any other field, User:Omegatron/monobook.js/dashfixer.js has a significant impact on our lives. Throughout history, User:Omegatron/monobook.js/dashfixer.js has been the subject of study, debate and controversy, and its influence remains relevant today. In this article, we will explore different aspects related to User:Omegatron/monobook.js/dashfixer.js, analyzing its importance and role in the contemporary world. From its origins to its relevance today, User:Omegatron/monobook.js/dashfixer.js has played a crucial role in the evolution of humanity and its study allows us to better understand the world around us.
function replacedash() {
    var txt = document.editform.wpTextbox1;

    // Convert all html entities into actual dash characters 
    txt.value = txt.value.replace(/(&#x2014;|&#8212;|&mdash;)/g, '—');
    txt.value = txt.value.replace(/(&#x2013|&#8211;|&ndash;)/g, '–');
    txt.value = txt.value.replace(/(&#x2212;|&#8722;|&minus;)/g, '−');

    // Convert -- and em dashes *with or without* spaces --> em dash character surrounded by spaces
    txt.value = txt.value.replace(/(\}\)])\s? ?(--|—|&mdash;)\s? ?()/g, '$1 — $3');

    // Convert - or en dashes *with* spaces --> em dash character surrounded by spaces
    txt.value = txt.value.replace(/(\}])( |&nbsp;) ?(-|–|&ndash;)  ?()/g, '$1$2— $4');

    // Convert hyphen next to lone number into a minus sign character
//    txt.value = txt.value.replace(/(\>])(\s)-(\d)/g, '$1$2−$3');
//    Should not touch anything inside math tags...

    // Em dashes for dates?
    txt.value = txt.value.replace(/(\d\d\d)\s?(--?|—|&mdash;)\s?(\d\d\d|\d\d)()/g, '$1–$3$4');

    // Add a tag to the summary box
    var txt = document.editform.wpSummary;
    var summary = "]";
	if (txt.value.indexOf(summary) == -1) {
		if (txt.value.match(/?\s*$/)) {
			txt.value += " | ";
		}
		txt.value += summary;
	}

    // Press the diff button to check it
    document.editform.wpDiff.click()
}

$(function () {
    if(document.forms.editform) {
        mw.util.addPortletLink('p-cactions', 'javascript:replacedash()', '—', 'ca-dashfixer', 'Fixes dash formatting', '', '');
    }
});