Content deleted Content added
m Fixing grammar |
Copying over latest from Bobblewik |
||
Line 41:
// ranked days
txt.value = txt.value.replace(/\[\[(\d{1,2}(?:st|nd|rd|th))\]\]/gi, '$1');
// misconfigured
Line 47 ⟶ 46:
txt.value = txt.value.replace(/\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}\|(\d{1,2})\]\]/gi, '$1');
//BC etc
txt.value = txt.value.replace(/\[\[(\d{1,4} (?:AD|BC|CE|BCE))\]\]/gi, '$1');
txt.value = txt.value.replace(/\[\[\d{1,4} (?:AD|BC|CE|BCE)\|(\d{1,4})\]\]/gi, '$1');
//4
txt.value = txt.value.replace(/\[\[\d{1,4}\|(\d{1,2})\]\]/gi, '$1');
//year: last character in link on left is not month or digit, first character in link on right is not month or digit▼
txt.value = txt.value.replace(/([^yhletr\d]\]\]\s?,?\-?\s?)\[\[(\d{1,4})\]\](\s?,?\-?\s?\[\[[^jfmasond\d])/gi, '$1$2$3');▼
//year pair: last character in link on left is not month or digit, first character in link on right is not month or digit▼
txt.value = txt.value.replace(/([^yhletr\d]\]\]\s?,?\-?\s?)\[\[(\d{1,4})\]\](.?.?.?.?.?.?)\[\[(\d{1,4})\]\](\s?,?\-?\s?\[\[[^jfmasond\d])/gi, '$1$2$3$4$5');▼
//year:
txt.value = txt.value.replace(/([\w\(\);:.\*\|\&]\s?,?\-?\s?)\[\[(\d{1,4})\]\]([^\[]{4})/gi, '$1$2$3');▼
txt.value = txt.value.replace(/([^yhletr\d]\]\]\s?,?\-?\s?)\[\[(\d{1,4})\]\]([^\[]{4})/gi, '$1$2$3');▼
//year pair: last character in link on left is not month or digit, avoid links on right▼
txt.value = txt.value.replace(/([^yhletr\d]\]\]\s?,?\-?\s?)\[\[(\d{1,4})\]\](.?.?.?.?.?.?)\[\[(\d{1,4})\]\]([^\[]{4})/gi, '$1$2$3$4$5');▼
//year: check for line-ends, text on left, avoid links on right. Run twice to deal better with lists.
▲ txt.value = txt.value.replace(/([\w\(\);:.\*\|\&]\s?,?\-?\s?|\n)\[\[(\d{1,4})\]\]([^\[]{4}|\n)/gi, '$1$2$3');
txt.value = txt.value.replace(/([
//year: avoid links on left, first character in link on right is not month or digit▼
txt.value = txt.value.replace(/([^\]]{4}
//year pair: avoid links on left, first character in link on right is not month or digit▼
txt.value = txt.value.replace(/([^\]]{4})\[\[(\d{1,4})\]\](.?.?.?.?.?.?)\[\[(\d{1,4})\]\](\s?,?\-?\s?\[\[[^jfmasond\d])/gi, '$1$2$3$4$5');
//year pair: text on left, avoid links on right
txt.value = txt.value.replace(/([\w\(\);:.\*\|\&]\s?,?\-?\s?)\[\[(\d{1,4})\]\](.?.?.?.?.?.?)\[\[(\d{1,4})\]\]([^\[]{4})/gi, '$1$2$3$4$5');
Line 72 ⟶ 83:
//year pair: avoid links on both sides
txt.value = txt.value.replace(/([^\]]{4})\[\[(\d{1,4})\]\](.?.?.?.?.?.?)\[\[(\d{1,4})\]\]([^\[]{4})/gi, '$1$2$3$4$5');
▲ txt.value = txt.value.replace(/([^yhletr\d]\]\]\s?,?\-?\s?)\[\[(\d{1,4})\]\]([^\[]{4})/gi, '$1$2$3');
▲ //year pair: last character in link on left is not month or digit, avoid links on right
▲ txt.value = txt.value.replace(/([^yhletr\d]\]\]\s?,?\-?\s?)\[\[(\d{1,4})\]\](.?.?.?.?.?.?)\[\[(\d{1,4})\]\]([^\[]{4})/gi, '$1$2$3$4$5');
▲ //year: avoid links on left, first character in link on right is not month or digit
▲ txt.value = txt.value.replace(/([^\]]{4})\[\[(\d{1,4})\]\](\s?,?\-?\s?\[\[[^jfmasond\d])/gi, '$1$2$3');
▲ //year pair: avoid links on left, first character in link on right is not month or digit
▲ txt.value = txt.value.replace(/([^\]]{4})\[\[(\d{1,4})\]\](.?.?.?.?.?.?)\[\[(\d{1,4})\]\](\s?,?\-?\s?\[\[[^jfmasond\d])/gi, '$1$2$3$4$5');
▲ //year: last character in link on left is not month or digit, first character in link on right is not month or digit
▲ txt.value = txt.value.replace(/([^yhletr\d]\]\]\s?,?\-?\s?)\[\[(\d{1,4})\]\](\s?,?\-?\s?\[\[[^jfmasond\d])/gi, '$1$2$3');
▲ //year pair: last character in link on left is not month or digit, first character in link on right is not month or digit
▲ txt.value = txt.value.replace(/([^yhletr\d]\]\]\s?,?\-?\s?)\[\[(\d{1,4})\]\](.?.?.?.?.?.?)\[\[(\d{1,4})\]\](\s?,?\-?\s?\[\[[^jfmasond\d])/gi, '$1$2$3$4$5');
// Add a tag to the summary box
Line 107 ⟶ 100:
addOnloadHook(function () {
if(document.forms.editform) {
addLink('p-cactions', 'javascript:formatdates()', '
}
});
|