Comparing version 3.5.0 to 4.0.0
@@ -66,3 +66,3 @@ Typograf.groups = [ | ||
{ | ||
"name": "sym", | ||
"name": "symbols", | ||
"title": { | ||
@@ -69,0 +69,0 @@ "en": "Symbols", |
@@ -66,3 +66,3 @@ [ | ||
{ | ||
"name": "sym", | ||
"name": "symbols", | ||
"title": { | ||
@@ -69,0 +69,0 @@ "en": "Symbols", |
/*! Typograf | © 2015 Denis Seleznev | https://github.com/typograf/typograf/ */ | ||
(function(root, factory) { | ||
'use strict'; | ||
@@ -15,4 +16,2 @@ if(typeof define === 'function' && define.amd) { | ||
'use strict'; | ||
/** | ||
@@ -58,6 +57,15 @@ * @constructor | ||
Typograf.rule = function(rule) { | ||
rule.enabled = rule.enabled === false || rule.disabled === true ? false : true; | ||
rule._lang = rule.name.split('/')[0]; | ||
rule.index = rule.index || /* istanbul ignore next */ 0; | ||
var parts = rule.name.split('/'); | ||
rule._enabled = rule.disabled === true ? false : true; | ||
rule._lang = parts[0]; | ||
rule._group = parts[1]; | ||
rule._name = parts[2]; | ||
Typograf._setIndex(rule); | ||
if(rule._lang !== 'common' && Typograf._langs.indexOf(rule._lang) !== -1) { | ||
Typograf._langs.push(rule._lang); | ||
} | ||
Typograf.prototype._rules.push(rule); | ||
@@ -72,2 +80,16 @@ | ||
Typograf._setIndex = function(rule) { | ||
var index = rule.index, | ||
t = typeof index, | ||
groupIndex = Typograf.groupIndexes[rule._group]; | ||
if(t === 'undefined') { | ||
index = groupIndex; | ||
} else if(t === 'string') { | ||
index = groupIndex + parseInt(rule.index, 10); | ||
} | ||
rule._index = index; | ||
}; | ||
/** | ||
@@ -81,3 +103,2 @@ * Add internal rule. | ||
* @param {Function} rule.handler Processing function | ||
* @param {string} [rule.index] Sorting index for rule | ||
* @return {Typograf} this | ||
@@ -89,8 +110,3 @@ */ | ||
rule._lang = rule.name.split('/')[0]; | ||
rule.index = rule.index || 0; | ||
if(Typograf._needSortRules) { | ||
this._sortInnerRules(); | ||
} | ||
return this; | ||
@@ -125,12 +141,6 @@ }; | ||
Typograf.prototype._rules.sort(function(a, b) { | ||
return a.index > b.index ? 1 : -1; | ||
return a._index > b._index ? 1 : -1; | ||
}); | ||
}; | ||
Typograf._sortInnerRules = function() { | ||
Typograf.prototype._innerRules.sort(function(a, b) { | ||
return a.index > b.index ? 1 : -1; | ||
}); | ||
}; | ||
Typograf._replace = function(text, re) { | ||
@@ -144,85 +154,3 @@ for(var i = 0; i < re.length; i++) { | ||
Typograf._quot = function(text, settings) { | ||
var letters = '\\d' + this.letters() + '\u0301', | ||
privateLabel = Typograf._privateLabel, | ||
lquot = settings.lquot, | ||
rquot = settings.rquot, | ||
lquot2 = settings.lquot2, | ||
rquot2 = settings.rquot2, | ||
quotes = '[' + Typograf.data('common/quot') + ']', | ||
phrase = '[' + letters + ')!?.:;#*,]*?', | ||
reL = new RegExp('"([…' + letters + '])', 'gi'), | ||
reR = new RegExp('(' + phrase + ')"(' + phrase + ')', 'gi'), | ||
reQuotes = new RegExp(quotes, 'g'), | ||
reFirstQuot = new RegExp('^(\\s)?(' + quotes + ')', 'g'), | ||
reOpeningTag = new RegExp('(^|\\s)' + quotes + privateLabel, 'g'), | ||
reClosingTag = new RegExp(privateLabel + quotes + '([\\s!?.:;#*,]|$)', 'g'), | ||
count = 0; | ||
text = text | ||
.replace(reQuotes, function() { | ||
count++; | ||
return '"'; | ||
}) | ||
.replace(reL, lquot + '$1') // Opening quote | ||
.replace(reR, '$1' + rquot + '$2') // Closing quote | ||
.replace(reOpeningTag, '$1' + lquot + privateLabel) // Opening quote and tag | ||
.replace(reClosingTag, privateLabel + rquot + '$1') // Tag and closing quote | ||
.replace(reFirstQuot, '$1' + lquot); | ||
if(lquot2 && rquot2 && count % 2 === 0) { | ||
return Typograf._innerQuot(text, settings); | ||
} | ||
return text; | ||
}; | ||
Typograf._innerQuot = function(text, settings) { | ||
var openingQuotes = [settings.lquot], | ||
closingQuotes = [settings.rquot], | ||
lquot = settings.lquot, | ||
rquot = settings.rquot, | ||
bufText = new Array(text.length); | ||
if(settings.lquot2 && settings.rquot2) { | ||
openingQuotes.push(settings.lquot2); | ||
closingQuotes.push(settings.rquot2); | ||
if(settings.lquot3 && settings.rquot3) { | ||
openingQuotes.push(settings.lquot3); | ||
closingQuotes.push(settings.rquot3); | ||
} | ||
} | ||
var level = -1, | ||
maxLevel = openingQuotes.length - 1; | ||
for(var i = 0, len = text.length; i < len; i++) { | ||
var letter = text[i]; | ||
if(letter === lquot) { | ||
level++; | ||
if(level > maxLevel) { | ||
level = maxLevel; | ||
} | ||
bufText.push(openingQuotes[level]); | ||
} else if(letter === rquot) { | ||
if(level <= -1) { | ||
level = 0; | ||
bufText.push(openingQuotes[level]); | ||
} else { | ||
bufText.push(closingQuotes[level]); | ||
level--; | ||
if(level < -1) { | ||
level = -1; | ||
} | ||
} | ||
} else { | ||
bufText.push(letter); | ||
} | ||
} | ||
return bufText.join(''); | ||
}; | ||
Typograf._langs = ['en', 'ru']; | ||
Typograf._langs = []; | ||
Typograf._privateLabel = '\uDBFF'; | ||
@@ -302,3 +230,5 @@ | ||
executeRulesForQueue(); | ||
text = this._modification(text, mode); | ||
executeRulesForQueue('entity'); | ||
@@ -379,15 +309,85 @@ if(this._isHTML) { | ||
}, | ||
/** | ||
* Get a string of characters with range for current language. | ||
* This is used in regular expressions in rules. | ||
* | ||
* @return {string} | ||
*/ | ||
letters: function() { | ||
var lang = this._lang || this._prefs.lang, | ||
commonLetter = Typograf.data('common/letter'), | ||
langLetter = Typograf.data(lang + '/letter'); | ||
_data: function(key) { | ||
return Typograf.data(this._lang + '/' + key); | ||
}, | ||
_quote: function(text, settings) { | ||
var letters = this._data('l') + '\u0301\\d', | ||
privateLabel = Typograf._privateLabel, | ||
lquote = settings.lquote, | ||
rquote = settings.rquote, | ||
lquote2 = settings.lquote2, | ||
rquote2 = settings.rquote2, | ||
quotes = '[' + Typograf.data('common/quote') + ']', | ||
phrase = '[' + letters + ')!?.:;#*,]*?', | ||
reL = new RegExp('"([…' + letters + '])', 'gi'), | ||
reR = new RegExp('(' + phrase + ')"(' + phrase + ')', 'gi'), | ||
reQuotes = new RegExp(quotes, 'g'), | ||
reFirstQuote = new RegExp('^(\\s)?(' + quotes + ')', 'g'), | ||
reOpeningTag = new RegExp('(^|\\s)' + quotes + privateLabel, 'g'), | ||
reClosingTag = new RegExp(privateLabel + quotes + '([\\s!?.:;#*,]|$)', 'g'), | ||
count = 0; | ||
return commonLetter === langLetter || !lang ? commonLetter : commonLetter + langLetter; | ||
text = text | ||
.replace(reQuotes, function() { | ||
count++; | ||
return '"'; | ||
}) | ||
.replace(reL, lquote + '$1') // Opening quote | ||
.replace(reR, '$1' + rquote + '$2') // Closing quote | ||
.replace(reOpeningTag, '$1' + lquote + privateLabel) // Opening quote and tag | ||
.replace(reClosingTag, privateLabel + rquote + '$1') // Tag and closing quote | ||
.replace(reFirstQuote, '$1' + lquote); | ||
if(lquote2 && rquote2 && count % 2 === 0) { | ||
return this._innerQuote(text, settings); | ||
} | ||
return text; | ||
}, | ||
_innerQuote: function(text, settings) { | ||
var openingQuotes = [settings.lquote], | ||
closingQuotes = [settings.rquote], | ||
lquote = settings.lquote, | ||
rquote = settings.rquote, | ||
bufText = new Array(text.length); | ||
if(settings.lquote2 && settings.rquote2) { | ||
openingQuotes.push(settings.lquote2); | ||
closingQuotes.push(settings.rquote2); | ||
if(settings.lquote3 && settings.rquote3) { | ||
openingQuotes.push(settings.lquote3); | ||
closingQuotes.push(settings.rquote3); | ||
} | ||
} | ||
var level = -1, | ||
maxLevel = openingQuotes.length - 1; | ||
for(var i = 0, len = text.length; i < len; i++) { | ||
var letter = text[i]; | ||
if(letter === lquote) { | ||
level++; | ||
if(level > maxLevel) { | ||
level = maxLevel; | ||
} | ||
bufText.push(openingQuotes[level]); | ||
} else if(letter === rquote) { | ||
if(level <= -1) { | ||
level = 0; | ||
bufText.push(openingQuotes[level]); | ||
} else { | ||
bufText.push(closingQuotes[level]); | ||
level--; | ||
if(level < -1) { | ||
level = -1; | ||
} | ||
} | ||
} else { | ||
bufText.push(letter); | ||
} | ||
} | ||
return bufText.join(''); | ||
}, | ||
_fixLineEnd: function(text) { | ||
@@ -407,3 +407,3 @@ return text.replace(/\r\n/g, '\n'); // Windows | ||
this._settings[name] = settings; | ||
this._enabledRules[name] = rule.enabled; | ||
this._enabledRules[name] = rule._enabled; | ||
}, | ||
@@ -558,2 +558,16 @@ _enable: function(rule, enabled) { | ||
Typograf.groupIndexes = { | ||
symbols: 110, | ||
space: 210, | ||
dash: 310, | ||
punctuation: 410, | ||
nbsp: 510, | ||
'number': 610, | ||
money: 710, | ||
date: 810, | ||
other: 910, | ||
optalign: 1010, | ||
html: 1110 | ||
}; | ||
Typograf.prototype.entities = []; | ||
@@ -830,90 +844,48 @@ | ||
Typograf.data('common/letter', 'a-z'); | ||
Typograf.data('common/quote', '«‹»›„‚“‟‘‛”’"'); | ||
Typograf.data('common/quot', '«‹»›„‚“‟‘‛”’"'); | ||
Typograf.data({ | ||
'en/l': 'a-z', | ||
'en/L': 'A-Z', | ||
'en/lL': 'a-zA-Z' | ||
}); | ||
Typograf.data('en/letter', 'a-z'); | ||
Typograf._langs.push('en'); | ||
Typograf.data('ru/dash', { | ||
before: '(^| |\\n)', | ||
after: '( |,|\\.|\\?|:|!|$)' | ||
Typograf.data({ | ||
'ru/dashBefore': '(^| |\\n)', | ||
'ru/dashAfter': '([\u00A0 ,.?:!]|$)' | ||
}); | ||
Typograf.data({ | ||
'ru/letter': 'а-яё', | ||
'ru/letterUpper': 'А-ЯЁ' | ||
'ru/l': 'а-яёa-z', | ||
'ru/L': 'А-ЯЁA-Z', | ||
'ru/lL': 'а-яёА-ЯЁa-zA-Z' | ||
}); | ||
Typograf._langs.push('ru'); | ||
Typograf.data({ | ||
'ru/month': [ | ||
'январь', | ||
'февраль', | ||
'март', | ||
'апрель', | ||
'май', | ||
'июнь', | ||
'июль', | ||
'август', | ||
'сентябрь', | ||
'октябрь', | ||
'ноябрь', | ||
'декабрь' | ||
], | ||
'ru/monthGenCase': [ | ||
'января', | ||
'февраля', | ||
'марта', | ||
'апреля', | ||
'мая', | ||
'июня', | ||
'июля', | ||
'августа', | ||
'сентября', | ||
'октября', | ||
'ноября', | ||
'декабря' | ||
], | ||
'ru/monthPreCase': [ | ||
'январе', | ||
'феврале', | ||
'марте', | ||
'апреле', | ||
'мае', | ||
'июне', | ||
'июле', | ||
'августе', | ||
'сентябре', | ||
'октябре', | ||
'ноябре', | ||
'декабре' | ||
], | ||
'ru/shortMonth': [ | ||
'янв', | ||
'фев', | ||
'мар', | ||
'апр', | ||
'ма[ейя]', | ||
'июн', | ||
'июл', | ||
'авг', | ||
'сен', | ||
'окт', | ||
'ноя', | ||
'дек' | ||
] | ||
'ru/month': 'январь|февраль|март|апрель|май|июнь|июль|август|сентябрь|октябрь|ноябрь|декабрь', | ||
'ru/monthGenCase': 'января|февраля|марта|апреля|мая|июня|июля|августа|сентября|октября|ноября|декабря', | ||
'ru/monthPreCase': 'январе|феврале|марте|апреле|мае|июне|июле|августе|сентябре|октябре|ноябре|декабре', | ||
'ru/shortMonth': 'янв|фев|мар|апр|ма[ейя]|июн|июл|авг|сен|окт|ноя|дек' | ||
}); | ||
Typograf.data('ru/weekday', [ | ||
'понедельник', | ||
'вторник', | ||
'среда', | ||
'четверг', | ||
'пятница', | ||
'суббота', | ||
'воскресенье' | ||
]); | ||
Typograf.data('ru/weekday', 'понедельник|вторник|среда|четверг|пятница|суббота|воскресенье'); | ||
Typograf.rule({ | ||
name: 'common/html/e-mail', | ||
handler: function(text) { | ||
return text.replace( | ||
/(^|[\s;(])([\w\-.]{2,})@([\w\-.]{2,})\.([a-z]{2,6})([)\s.,!?]|$)/gi, | ||
'$1<a href="mailto:$2@$3.$4">$2@$3.$4</a>$5' | ||
); | ||
}, | ||
disabled: true | ||
}); | ||
Typograf.rule({ | ||
name: 'common/html/escape', | ||
index: 110, | ||
index: '+100', | ||
queue: 'end', | ||
@@ -938,17 +910,5 @@ handler: function(text) { | ||
Typograf.rule({ | ||
name: 'common/html/mail', | ||
index: 2000, | ||
handler: function(text) { | ||
return text.replace( | ||
/(^|[\s;(])([\w\-.]{2,})@([\w\-.]{2,})\.([a-z]{2,6})([)\s.,!?]|$)/gi, | ||
'$1<a href="mailto:$2@$3.$4">$2@$3.$4</a>$5' | ||
); | ||
}, | ||
disabled: true | ||
}); | ||
Typograf.rule({ | ||
name: 'common/html/nbr', | ||
index: 110, | ||
queue: 'start', | ||
index: '+5', | ||
queue: 'end', | ||
handler: function(text) { | ||
@@ -962,3 +922,2 @@ return text.search(/<br/) === -1 ? text.replace(/\n/g, '<br/>\n') : text; | ||
name: 'common/html/pbr', | ||
index: 90, | ||
queue: 'end', | ||
@@ -982,6 +941,6 @@ handler: function(text) { | ||
name: 'common/html/stripTags', | ||
index: 100, | ||
index: '+99', | ||
queue: 'end', | ||
handler: function(text) { | ||
return text.replace(/<\/?[^>]+>/g, ''); | ||
return text.replace(/<[^>]+>/g, ''); | ||
}, | ||
@@ -993,3 +952,2 @@ disabled: true | ||
name: 'common/html/url', | ||
index: 2010, | ||
handler: function(text) { | ||
@@ -1004,3 +962,3 @@ var prefix = '(http|https|ftp|telnet|news|gopher|file|wais)://', | ||
.replace(/^([^\/]+)\/$/, '$1'); // Remove ending / | ||
if(protocol === 'http') { | ||
@@ -1030,17 +988,18 @@ path = path.replace(/^([^\/]+)(:80)([^\d]|\/|$)/, '$1$3'); // Remove 80 port | ||
name: 'common/nbsp/afterNumber', | ||
index: 615, | ||
handler: function(text) { | ||
var re = '(^|\\D)(\\d{1,5}) ([' + | ||
this.letters() + | ||
this._data('l') + | ||
']{2,})'; | ||
return text.replace(new RegExp(re, 'gi'), '$1$2\u00A0$3'); | ||
} | ||
}, | ||
disabled: true | ||
}); | ||
Typograf.rule({ | ||
name: 'common/nbsp/afterPara', | ||
index: 610, | ||
name: 'common/nbsp/afterParagraph', | ||
handler: function(text) { | ||
return text.replace(/§ ?(\d|I|V|X)/g, '§\u00A0$1'); | ||
// \u2009 - THIN SPACE | ||
// \u202F - NARROW NO-BREAK SPACE | ||
return text.replace(/\u00A7[ \u00A0\u2009]?(\d|I|V|X)/g, '\u00A7\u202F$1'); | ||
} | ||
@@ -1051,7 +1010,6 @@ }); | ||
name: 'common/nbsp/afterShortWord', | ||
index: 590, | ||
handler: function(text, settings) { | ||
var len = settings.lengthShortWord, | ||
before = ' \u00A0(' + Typograf._privateLabel + Typograf.data('common/quot'), | ||
subStr = '(^|[' + before + '])([' + this.letters() + ']{1,' + len + '}) ', | ||
before = ' \u00A0(' + Typograf._privateLabel + Typograf.data('common/quote'), | ||
subStr = '(^|[' + before + '])([' + this._data('l') + ']{1,' + len + '}) ', | ||
newSubStr = '$1$2\u00A0', | ||
@@ -1071,10 +1029,7 @@ re = new RegExp(subStr, 'gim'); | ||
name: 'common/nbsp/beforeShortLastWord', | ||
index: 620, | ||
handler: function(text, settings) { | ||
var punc = '.,?!:;', | ||
re = new RegExp('([^' + punc + ']) ([' + | ||
this.letters() + ']{1,' + settings.lengthLastWord + | ||
'}[' + punc + '\n])', 'gi'); | ||
return text.replace(re, '$1\u00A0$2'); | ||
var re = new RegExp('([' + this._data('l') + '\d]) ([' + | ||
this._data('lL') + ']{1,' + settings.lengthLastWord + | ||
'}[.!?])( [' + this._data('L') + ']|$)', 'g'); | ||
return text.replace(re, '$1\u00A0$2$3'); | ||
}, | ||
@@ -1088,3 +1043,2 @@ settings: { | ||
name: 'common/nbsp/dpi', | ||
index: 1150, | ||
handler: function(text) { | ||
@@ -1103,4 +1057,3 @@ return text.replace(/(\d) ?(lpi|dpi)(?!\w)/, '$1\u00A0$2'); | ||
name: 'common/nbsp/nowrap', | ||
index: 100, | ||
queue: 'start', | ||
queue: 'end', | ||
handler: function(text) { | ||
@@ -1126,3 +1079,2 @@ return text | ||
name: 'common/number/fraction', | ||
index: 1120, | ||
handler: function(text) { | ||
@@ -1137,3 +1089,2 @@ return text.replace(/(^|\D)1\/2(\D|$)/g, '$1½$2') | ||
name: 'common/number/mathSigns', | ||
index: 1010, | ||
handler: function(text) { | ||
@@ -1155,3 +1106,2 @@ return Typograf._replace(text, [ | ||
name: 'common/number/times', | ||
index: 1050, | ||
handler: function(text) { | ||
@@ -1165,2 +1115,3 @@ return text.replace(/(\d)[ \u00A0]?(x|х)[ \u00A0]?(\d)/g, '$1×$3'); | ||
queue: 'start', | ||
index: -1, | ||
handler: function(text) { | ||
@@ -1177,9 +1128,8 @@ if(text.charCodeAt(0) === 0xFEFF) { | ||
name: 'common/other/repeatWord', | ||
index: 1200, | ||
handler: function(text) { | ||
var re = '([' + | ||
this.letters() + | ||
'\u0301]+) \\1([;:,.?! \n])'; | ||
var re = new RegExp('([' + | ||
this._data('l') + | ||
'\u0301]+) \\1([;:,.?! \n])', 'gi'); | ||
return text.replace(new RegExp(re, 'gi'), '$1$2'); | ||
return text.replace(re, '$1$2'); | ||
}, | ||
@@ -1191,3 +1141,2 @@ disabled: true | ||
name: 'common/punctuation/delDoublePunctuation', | ||
index: 580, | ||
handler: function(text) { | ||
@@ -1204,27 +1153,6 @@ return text | ||
Typograf.rule({ | ||
name: 'common/punctuation/exclamation', | ||
index: 1140, | ||
live: false, | ||
handler: function(text) { | ||
return text | ||
.replace(/(^|[^!])!{2}($|[^!])/, '$1!$2') | ||
.replace(/(^|[^!])!{4}($|[^!])/, '$1!!!$2'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'common/punctuation/exclamationQuestion', | ||
index: 1150, | ||
handler: function(text) { | ||
var re = new RegExp('(^|[^!])!\\?([^?]|$)', 'g'); | ||
return text.replace(re, '$1?!$2'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'common/space/afterPunctuation', | ||
index: 560, | ||
handler: function(text) { | ||
var privateLabel = Typograf._privateLabel, | ||
reExcl = new RegExp('(!|;|\\?)([^.!;?\\s[\\])' + privateLabel + Typograf.data('common/quot') + '])', 'g'), | ||
reExcl = new RegExp('(!|;|\\?)([^.!;?\\s[\\])' + privateLabel + Typograf.data('common/quote') + '])', 'g'), | ||
reComma = new RegExp('(\\D)(,|:)([^,:.?\\s\\/' + privateLabel + '])', 'g'); | ||
@@ -1240,5 +1168,4 @@ | ||
name: 'common/space/beforeBracket', | ||
index: 560, | ||
handler: function(text) { | ||
var re = new RegExp('([' + this.letters() + '.!?,;…)])\\(', 'gi'); | ||
var re = new RegExp('([' + this._data('l') + '.!?,;…)])\\(', 'gi'); | ||
return text.replace(re, '$1 ('); | ||
@@ -1250,3 +1177,2 @@ } | ||
name: 'common/space/bracket', | ||
index: 560, | ||
handler: function(text) { | ||
@@ -1261,3 +1187,2 @@ return text | ||
name: 'common/space/delBeforePercent', | ||
index: 600, | ||
handler: function(text) { | ||
@@ -1270,3 +1195,2 @@ return text.replace(/(\d)( |\u00A0)(%|‰|‱)/g, '$1$3'); | ||
name: 'common/space/delBeforePunctuation', | ||
index: 550, | ||
handler: function(text) { | ||
@@ -1279,3 +1203,2 @@ return text.replace(/ ([!;,?.:])/g, '$1'); | ||
name: 'common/space/delLeadingBlanks', | ||
index: 504, | ||
handler: function(text) { | ||
@@ -1289,3 +1212,3 @@ return text.replace(/\n[ \t]+/g, '\n'); | ||
name: 'common/space/delRepeatN', | ||
index: 545, | ||
index: '-1', | ||
handler: function(text) { | ||
@@ -1298,3 +1221,3 @@ return text.replace(/\n{3,}/g, '\n\n'); | ||
name: 'common/space/delRepeatSpace', | ||
index: 540, | ||
index: '-1', | ||
handler: function(text) { | ||
@@ -1307,3 +1230,3 @@ return text.replace(/([^\n \t])( |\t){2,}([^\n \t])/g, '$1$2$3'); | ||
name: 'common/space/delTrailingBlanks', | ||
index: 505, | ||
index: '-3', | ||
handler: function(text) { | ||
@@ -1316,5 +1239,5 @@ return text.replace(/[ \t]+\n/g, '\n'); | ||
name: 'common/space/replaceTab', | ||
index: 510, | ||
index: '-5', | ||
handler: function(text) { | ||
return text.replace(/\t/g, ' '); | ||
return text.replace(/\t/g, ' '); | ||
} | ||
@@ -1325,3 +1248,2 @@ }); | ||
name: 'common/space/squareBracket', | ||
index: 560, | ||
handler: function(text) { | ||
@@ -1336,3 +1258,3 @@ return text | ||
name: 'common/space/trimLeft', | ||
index: 530, | ||
index: '-4', | ||
handler: String.prototype.trimLeft ? function(text) { | ||
@@ -1347,3 +1269,3 @@ return text.trimLeft(); | ||
name: 'common/space/trimRight', | ||
index: 535, | ||
index: '-3', | ||
live: false, | ||
@@ -1358,4 +1280,3 @@ handler: String.prototype.trimRight ? function(text) { | ||
Typograf.rule({ | ||
name: 'common/sym/arrow', | ||
index: 1130, | ||
name: 'common/symbols/arrow', | ||
handler: function(text) { | ||
@@ -1370,4 +1291,3 @@ return Typograf._replace(text, [ | ||
Typograf.rule({ | ||
name: 'common/sym/cf', | ||
index: 1020, | ||
name: 'common/symbols/cf', | ||
handler: function(text) { | ||
@@ -1381,4 +1301,3 @@ var re = new RegExp('(\\d+)( |\u00A0)?(C|F)([\\W \\.,:!\\?"\\]\\)]|$)', 'g'); | ||
Typograf.rule({ | ||
name: 'common/sym/copy', | ||
index: 10, | ||
name: 'common/symbols/copy', | ||
handler: function(text) { | ||
@@ -1394,10 +1313,11 @@ return Typograf._replace(text, [ | ||
Typograf.rule({ | ||
name: 'en/punctuation/quot', | ||
index: 700, | ||
handler: Typograf._quot, | ||
name: 'en/punctuation/quote', | ||
handler: function(text, settings) { | ||
return this._quote(text, settings); | ||
}, | ||
settings: { | ||
lquot: '“', | ||
rquot: '”', | ||
lquot2: '‘', | ||
rquot2: '’' | ||
lquote: '“', | ||
rquote: '”', | ||
lquote2: '‘', | ||
rquote2: '’' | ||
} | ||
@@ -1407,7 +1327,55 @@ }); | ||
Typograf.rule({ | ||
name: 'ru/dash/centuries', | ||
handler: function(text) { | ||
var dashes = '(' + Typograf.data('common/dash') + ')', | ||
re = new RegExp('(X|I|V)[ |\u00A0]?' + dashes + '[ |\u00A0]?(X|I|V)', 'g'); | ||
return text.replace(re, '$1' + this.setting('ru/dash/centuries', 'dash') + '$3'); | ||
}, | ||
settings: { | ||
dash: '\u2014' // — | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/dash/daysMonth', | ||
handler: function(text) { | ||
var re = new RegExp('(^|\\s)([123]?\\d)' + | ||
'(' + Typograf.data('common/dash') + ')' + | ||
'([123]?\\d)[ \u00A0]' + | ||
'(' + Typograf.data('ru/monthGenCase') + ')', 'g'); | ||
return text.replace(re, '$1$2\u2014$4\u00A0$5'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/dash/decade', | ||
handler: function(text) { | ||
var re = new RegExp('(^|\\s)(\\d{3}|\\d)0' + | ||
'(' + Typograf.data('common/dash') + ')' + | ||
'(\\d{3}|\\d)0(-е[ \u00A0])' + | ||
'(?=г\\.?[ \u00A0]?г|год)', 'g'); | ||
return text.replace(re, '$1$20\u2014$40$5'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/dash/directSpeech', | ||
handler: function(text) { | ||
var dashes = Typograf.data('common/dash'), | ||
re1 = new RegExp('(["»‘“,.…?!])[ |\u00A0]?(' + dashes + ')[ |\u00A0]', 'g'), | ||
re2 = new RegExp('(^|' + Typograf._privateLabel + ')(' + dashes + ')( |\u00A0)', 'gm'); | ||
return text | ||
.replace(re1, '$1 \u2014\u00A0') | ||
.replace(re2, '$1\u2014\u00A0'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/dash/izpod', | ||
index: 35, | ||
handler: function(text) { | ||
var ruDash = Typograf.data('ru/dash'), | ||
re = new RegExp(ruDash.before + '(И|и)з под' + ruDash.after, 'g'); | ||
var re = new RegExp(Typograf.data('ru/dashBefore') + '(И|и)з под' + Typograf.data('ru/dashAfter'), 'g'); | ||
@@ -1420,6 +1388,4 @@ return text.replace(re, '$1$2з-под$3'); | ||
name: 'ru/dash/izza', | ||
index: 33, | ||
handler: function(text) { | ||
var ruDash = Typograf.data('ru/dash'), | ||
re = new RegExp(ruDash.before + '(И|и)з за' + ruDash.after, 'g'); | ||
var re = new RegExp(Typograf.data('ru/dashBefore') + '(И|и)з за' + Typograf.data('ru/dashAfter'), 'g'); | ||
@@ -1432,5 +1398,5 @@ return text.replace(re, '$1$2з-за$3'); | ||
name: 'ru/dash/kade', | ||
index: 31, | ||
handler: function(text) { | ||
var re = new RegExp('([a-яё]+)( | ?- ?)(ка|де|кась)' + Typograf.data('ru/dash').after, 'g'); | ||
var re = new RegExp('([a-яё]+)( | ?- ?)(ка|де|кась)' + Typograf.data('ru/dashAfter'), 'g'); | ||
return text.replace(re, '$1-$3$4'); | ||
@@ -1442,6 +1408,6 @@ } | ||
name: 'ru/dash/koe', | ||
index: 38, | ||
handler: function(text) { | ||
var ruDash = Typograf.data('ru/dash'), | ||
re = new RegExp(ruDash.before + '([Кк]о[ей])\\s([а-яё]{3,})' + ruDash.after, 'g'); | ||
var re = new RegExp(Typograf.data('ru/dashBefore') + | ||
'([Кк]о[ей])\\s([а-яё]{3,})' + | ||
Typograf.data('ru/dashAfter'), 'g'); | ||
@@ -1454,25 +1420,8 @@ return text.replace(re, '$1$2-$3$4'); | ||
name: 'ru/dash/main', | ||
index: 620, | ||
index: '-5', | ||
handler: function(text) { | ||
var name = 'ru/dash/main', | ||
dash = this.setting(name, 'dash'), | ||
dashes = '(' + Typograf.data('common/dash') + ')', | ||
ruLetter = Typograf.data('ru/letter'), | ||
reMain = new RegExp('( |\u00A0)' + dashes + '( |\\n)', 'g'), | ||
reDirect1 = new RegExp('(["»‘“,.…?!])[ |\u00A0]?' + dashes + '[ |\u00A0]', 'g'), | ||
reDirect2 = new RegExp('(^|' + Typograf._privateLabel + ')' + dashes + '( |\u00A0)', 'gm'), | ||
reInterval = new RegExp('(X|I|V)[ |\u00A0]?' + dashes + '[ |\u00A0]?(X|I|V)', 'g'), | ||
reSurname = new RegExp('([' + Typograf.data('ru/letterUpper') + '][' + | ||
ruLetter + ']+)\\s-([' + ruLetter + ']{1,3})(?![^' + ruLetter + ']|$)', 'g'); | ||
var dashes = Typograf.data('common/dash'), | ||
re = new RegExp('( |\u00A0)(' + dashes + ')( |\\n)', 'g'); | ||
return text | ||
.replace(reMain, '\u00A0' + dash + '$3') | ||
.replace(reDirect1, '$1 ' + dash + '\u00A0') // Прямая речь | ||
.replace(reDirect2, '$1' + dash + '\u00A0') | ||
.replace(reInterval, '$1' + this.setting(name, 'dashInterval') + '$3') // Интервалы | ||
.replace(reSurname, '$1\u00A0' + dash + '$2'); // Сокращения с помощью тире, редкий случай | ||
}, | ||
settings: { | ||
dash: '\u2014', // — | ||
dashInterval: '\u2014' // — | ||
return text.replace(re, '\u00A0\u2014$3'); | ||
} | ||
@@ -1483,8 +1432,6 @@ }); | ||
name: 'ru/dash/month', | ||
index: 610, | ||
handler: function(text) { | ||
var months = '(' + Typograf.data('ru/month').join('|') + ')', | ||
monthsPre = '(' + Typograf.data('ru/monthPreCase').join('|') + ')', | ||
var months = '(' + Typograf.data('ru/month') + ')', | ||
monthsPre = '(' + Typograf.data('ru/monthPreCase') + ')', | ||
dashes = Typograf.data('common/dash'), | ||
dashInterval = this.setting('ru/dash/main', 'dashInterval'), | ||
re = new RegExp(months + ' ?(' + dashes + ') ?' + months, 'gi'), | ||
@@ -1494,4 +1441,4 @@ rePre = new RegExp(monthsPre + ' ?(' + dashes + ') ?' + monthsPre, 'gi'); | ||
return text | ||
.replace(re, '$1' + dashInterval + '$3') | ||
.replace(rePre, '$1' + dashInterval + '$3'); | ||
.replace(re, '$1\u2014$3') | ||
.replace(rePre, '$1\u2014$3'); | ||
} | ||
@@ -1501,7 +1448,15 @@ }); | ||
Typograf.rule({ | ||
name: 'ru/dash/surname', | ||
handler: function(text) { | ||
var re = new RegExp('([А-ЯЁ][а-яё]+)\\s-([а-яё]{1,3})(?![^а-яё]|$)', 'g'); | ||
return text.replace(re, '$1\u00A0\u2014$2'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/dash/taki', | ||
index: 39, | ||
handler: function(text) { | ||
var re = new RegExp('(верно|довольно|опять|прямо|так|вс[её]|действительно|неужели)\\s(таки)' + | ||
Typograf.data('ru/dash').after, 'g'); | ||
Typograf.data('ru/dashAfter'), 'g'); | ||
@@ -1513,4 +1468,16 @@ return text.replace(re, '$1-$2$3'); | ||
Typograf.rule({ | ||
name: 'ru/dash/time', | ||
handler: function(text) { | ||
var re = new RegExp(Typograf.data('ru/dashBefore') + | ||
'(\\d?\\d:[0-5]\\d)' + | ||
Typograf.data('common/dash') + | ||
'(\\d?\\d:[0-5]\\d)' + | ||
Typograf.data('ru/dashAfter'), 'g'); | ||
return text.replace(re, '$1$2\u2014$3$4'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/dash/to', | ||
index: 30, | ||
handler: function(text) { | ||
@@ -1525,3 +1492,3 @@ var words = [ | ||
re = new RegExp('(' + words.join('|') + ')( | ?- ?)(то|либо|нибудь)' + | ||
Typograf.data('ru/dash').after, 'gi'); | ||
Typograf.data('ru/dashAfter'), 'gi'); | ||
@@ -1534,8 +1501,7 @@ return text.replace(re, '$1-$3$4'); | ||
name: 'ru/dash/weekday', | ||
index: 600, | ||
handler: function(text) { | ||
var part = '(' + Typograf.data('ru/weekday').join('|') + ')', | ||
var part = '(' + Typograf.data('ru/weekday') + ')', | ||
re = new RegExp(part + ' ?(' + Typograf.data('common/dash') + ') ?' + part, 'gi'); | ||
return text.replace(re, '$1' + this.setting('ru/dash/main', 'dashInterval') + '$3'); | ||
return text.replace(re, '$1\u2014$3'); | ||
} | ||
@@ -1545,5 +1511,25 @@ }); | ||
Typograf.rule({ | ||
name: 'ru/date/main', | ||
index: 1300, | ||
name: 'ru/dash/years', | ||
handler: function(text) { | ||
var dash = this.setting('ru/dash/years', 'dash'), | ||
dashes = Typograf.data('common/dash'), | ||
re = new RegExp('(\\D|^)(\\d{4})[ \u00A0]?(' + | ||
dashes + ')[ \u00A0]?(\\d{4})(?=[ \u00A0]?г)', 'g'); | ||
return text.replace(re, function($0, $1, $2, $3, $4) { | ||
if(parseInt($2, 10) < parseInt($4, 10)) { | ||
return $1 + $2 + dash + $4; | ||
} | ||
return $0; | ||
}); | ||
}, | ||
settings: { | ||
dash: '\u2014' // — | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/date/fromISO', | ||
handler: function(text) { | ||
var sp1 = '(-|\\.|\\/)', | ||
@@ -1553,3 +1539,3 @@ sp2 = '(-|\\/)', | ||
re2 = new RegExp('(^|\\D)(\\d{2})' + sp2 + '(\\d{2})' + sp2 + '(\\d{4})(\\D|$)', 'gi'); | ||
return text | ||
@@ -1563,7 +1549,6 @@ .replace(re1, '$1$6.$4.$2$7') | ||
name: 'ru/date/weekday', | ||
index: 1310, | ||
handler: function(text) { | ||
var space = '( |\u00A0)', | ||
monthCase = Typograf.data('ru/monthGenCase').join('|'), | ||
weekday = Typograf.data('ru/weekday').join('|'), | ||
monthCase = Typograf.data('ru/monthGenCase'), | ||
weekday = Typograf.data('ru/weekday'), | ||
re = new RegExp('(\\d)' + space + '(' + monthCase + '),' + space + '(' + weekday + ')', 'gi'); | ||
@@ -1580,3 +1565,2 @@ | ||
name: 'ru/money/dollar', | ||
index: 1140, | ||
handler: function(text) { | ||
@@ -1595,5 +1579,4 @@ var re1 = new RegExp('(^|[\\D]{2,})\\$ ?([\\d.,]+)', 'g'), | ||
name: 'ru/money/euro', | ||
index: 1140, | ||
handler: function(text) { | ||
var re1 = new RegExp('(^|[\\D]{2,})€ ?([\\d.]+)', 'g'), | ||
var re1 = new RegExp('(^|[\\D]{2,})€ ?([\\d.,]+([ \u00A0\u2009\u202F]\\d{3})*)', 'g'), | ||
re2 = new RegExp('(^|[\\D])([\\d.,]+) ?€', 'g'), | ||
@@ -1610,3 +1593,2 @@ rep = '$1$2\u00A0€'; | ||
name: 'ru/money/ruble', | ||
index: 1145, | ||
handler: function(text) { | ||
@@ -1624,3 +1606,2 @@ var rep = '$1\u00A0₽'; | ||
name: 'ru/nbsp/abbr', | ||
index: 565, | ||
handler: function(text) { | ||
@@ -1643,3 +1624,2 @@ var re = new RegExp('(^|\\s|' + Typograf._privateLabel + ')(([а-яё]{1,3}\\.){2,})(?![а-яё])', 'g'); | ||
name: 'ru/nbsp/addr', | ||
index: 1115, | ||
handler: function(text) { | ||
@@ -1653,3 +1633,3 @@ return text | ||
/* | ||
область, край, город, станция, поселок, село, | ||
область, край, станция, поселок, село, | ||
деревня, улица, переулок, проезд, проспект, | ||
@@ -1659,3 +1639,5 @@ бульвар, площадь, набережная, шоссе, | ||
*/ | ||
.replace(/(\s|^)(обл|кр|г|ст|пос|с|д|ул|пер|пр|пр\-т|просп|пл|бул|б\-р|наб|ш|туп|оф|комн?|уч|вл|влад|стр|кор)\. *([а-яёa-z\d]+)/gi, '$1$2.\u00A0$3'); | ||
.replace(/(\s|^)(обл|кр|ст|пос|с|д|ул|пер|пр|пр\-т|просп|пл|бул|б\-р|наб|ш|туп|оф|комн?|уч|вл|влад|стр|кор)\. *([а-яёa-z\d]+)/gi, '$1$2.\u00A0$3') | ||
// город | ||
.replace(/(\D[ \u00A0]|^)г\. ?([А-ЯЁ])/gm, '$1г.\u00A0$2'); | ||
} | ||
@@ -1666,5 +1648,6 @@ }); | ||
name: 'ru/nbsp/afterNumberSign', | ||
index: 610, | ||
handler: function(text) { | ||
return text.replace(/№ ?(\d|п\/п)/g, '№\u00A0$1'); | ||
// \u2009 - THIN SPACE | ||
// \u202F - NARROW NO-BREAK SPACE | ||
return text.replace(/№[ \u00A0\u2009]?(\d|п\/п)/g, '№\u202F$1'); | ||
} | ||
@@ -1675,3 +1658,3 @@ }); | ||
name: 'ru/nbsp/beforeParticle', | ||
index: 600, | ||
index: '+5', | ||
handler: function(text) { | ||
@@ -1689,8 +1672,11 @@ var particles = '(ли|ль|же|ж|бы|б)', | ||
Typograf.rule({ | ||
name: 'ru/nbsp/cc', | ||
index: 1090, | ||
name: 'ru/nbsp/centuries', | ||
handler: function(text) { | ||
text = text.replace(/(^|\d|V|I|X) ?в(в)?( |,|;|\n|$)/g, '$1\u00A0в$2.$3'); | ||
var dashes = Typograf.data('common/dash'), | ||
re1 = new RegExp('(^|\\s)([VIX]+)[ \u00A0]?в\\.?(?=[^.]|$)', 'g'), | ||
re2 = new RegExp('(^|\\s)([VIX]+)(' + dashes + ')([VIX]+)[ \u00A0]?в\\.?([ \u00A0]?в\\.?)?(?=[^.]|$)', 'g'); | ||
return text.replace(/(^|\d|[IVX]) ?в\.? ?в\./g, '$1\u00A0вв.'); | ||
return text | ||
.replace(re1, '$1$2\u00A0в.') | ||
.replace(re2, '$1$2$3$4\u00A0вв.'); | ||
} | ||
@@ -1701,5 +1687,4 @@ }); | ||
name: 'ru/nbsp/dayMonth', | ||
index: 1105, | ||
handler: function(text) { | ||
var re = new RegExp('(\\d{1,2}) (' + Typograf.data('ru/shortMonth').join('|') + ')', 'gi'); | ||
var re = new RegExp('(\\d{1,2}) (' + Typograf.data('ru/shortMonth') + ')', 'gi'); | ||
return text.replace(re, '$1\u00A0$2'); | ||
@@ -1711,3 +1696,3 @@ } | ||
name: 'ru/nbsp/m', | ||
index: 1030, | ||
index: '+5', | ||
handler: function(text) { | ||
@@ -1719,3 +1704,2 @@ var label = Typograf._privateLabel, | ||
// jshint maxparams:6 | ||
return text.replace(re, function($0, $1, $2, $3, $4, $5) { | ||
@@ -1737,3 +1721,2 @@ var pow = { | ||
name: 'ru/nbsp/ooo', | ||
index: 1100, | ||
handler: function(text) { | ||
@@ -1746,3 +1729,2 @@ return text.replace(/(^|[^a-яёA-ЯЁ])(ООО|ОАО|ЗАО|НИИ|ПБОЮЛ) /g, '$1$2\u00A0'); | ||
name: 'ru/nbsp/page', | ||
index: 610, | ||
handler: function(text) { | ||
@@ -1759,3 +1741,2 @@ var re = new RegExp('(^|[)\\s' + Typograf._privateLabel + '])' + | ||
name: 'ru/nbsp/ps', | ||
index: 565, | ||
handler: function(text) { | ||
@@ -1769,7 +1750,10 @@ var re = new RegExp('(^|\\s|' + Typograf._privateLabel + ')[pз]\\.[ \u00A0]?([pз]\\.[ \u00A0]?)?[sы]\\.:? ', 'gim'); | ||
/*jshint maxlen:1000 */ | ||
Typograf.rule({ | ||
name: 'ru/nbsp/xxxx', | ||
index: 1060, | ||
name: 'ru/nbsp/see', | ||
handler: function(text) { | ||
return text.replace(/(^|\D)(\d{1,4}) ?г(од| |,|;|\.|\n|$)/g, '$1$2\u00A0г$3'); | ||
var re = new RegExp('(^|\\s|' + Typograf._privateLabel + '|\\()(см|им)\\.[ \u00A0]?([а-яё0-9a-z]+)([\\s.,?!]|$)', 'gi'); | ||
return text.replace(re, function($0, $1, $2, $3, $4) { | ||
return ($1 === '\u00A0' ? ' ' : $1) + $2 + '.\u00A0' + $3 + $4; | ||
}); | ||
} | ||
@@ -1779,6 +1763,5 @@ }); | ||
Typograf.rule({ | ||
name: 'ru/nbsp/yy', | ||
index: 1080, | ||
name: 'ru/nbsp/year', | ||
handler: function(text) { | ||
return text.replace(/(^|\d) ?г\. ?г\./g, '$1\u00A0гг.'); | ||
return text.replace(/(^|\D)(\d{4}) ?г([ ,;.\n]|$)/g, '$1$2\u00A0г$3'); | ||
} | ||
@@ -1788,6 +1771,17 @@ }); | ||
Typograf.rule({ | ||
name: 'ru/nbsp/years', | ||
index: '+5', | ||
handler: function(text) { | ||
var dashes = Typograf.data('common/dash'), | ||
re = new RegExp('(^|\\D)(\\d{4})(' + | ||
dashes + ')(\\d{4})[ \u00A0]?г\\.?([ \u00A0]?г\\.)?', 'g'); | ||
return text.replace(re, '$1$2$3$4\u00A0гг.'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/number/ordinals', | ||
index: 1300, | ||
handler: function(text) { | ||
var re = new RegExp('(\\d)-(ый|ой|ая|ое|ые|ым|ом|ых|ого|ому|ыми)(?![' + this.letters() + '])', 'g'); | ||
var re = new RegExp('(\\d)-(ый|ой|ая|ое|ые|ым|ом|ых|ого|ому|ыми)(?![' + this._data('l') + '])', 'g'); | ||
@@ -1817,7 +1811,6 @@ return text.replace(re, function($0, $1, $2) { | ||
name: 'ru/optalign/bracket', | ||
index: 1001, | ||
handler: function(text, settings) { | ||
return text | ||
.replace(/( |\u00A0)\(/g, '<span class="typograf-oa-sp-lbracket">$1</span><span class="typograf-oa-lbracket">(</span>') | ||
.replace(/(^|\n)\(/g, '$1<span class="typograf-oa-n-lbracket">(</span>'); | ||
.replace(/^\(/gm, '<span class="typograf-oa-n-lbracket">(</span>'); | ||
}, | ||
@@ -1830,3 +1823,3 @@ disabled: true | ||
// Зачистка HTML-тегов от висячей пунктуации для скобки | ||
return text.replace(/<span class="typograf-oa-(sp-lbracket|lbracket|n-lbracket)">(.*?)<\/span>/g, '$2'); | ||
return text.replace(/<span class="typograf-oa-(n-|sp-)?lbracket">(.*?)<\/span>/g, '$2'); | ||
} | ||
@@ -1838,5 +1831,4 @@ }); | ||
name: 'ru/optalign/comma', | ||
index: 1002, | ||
handler: function(text, settings) { | ||
var re = new RegExp('([' + this.letters() + '\\d\u0301]+), ', 'gi'); | ||
var re = new RegExp('([' + this._data('l') + '\\d\u0301]+), ', 'gi'); | ||
return text.replace(re, '$1<span class="typograf-oa-comma">,</span><span class="typograf-oa-comma-sp"> </span>'); | ||
@@ -1850,3 +1842,3 @@ }, | ||
// Зачистка HTML-тегов от висячей пунктуации для запятой | ||
return text.replace(/<span class="typograf-oa-(comma|comma-sp)">(.*?)<\/span>/g, '$2'); | ||
return text.replace(/<span class="typograf-oa-comma(-sp)?">(.*?)<\/span>/g, '$2'); | ||
} | ||
@@ -1857,15 +1849,16 @@ }); | ||
Typograf.rule({ | ||
name: 'ru/optalign/quot', | ||
index: 1000, | ||
name: 'ru/optalign/quote', | ||
handler: function(text) { | ||
var lquotes = '(["' + | ||
this.setting('ru/punctuation/quot', 'lquot') + | ||
this.setting('ru/punctuation/quot', 'lquot2') + | ||
var name = 'ru/punctuation/quote', | ||
lquotes = '(["' + | ||
this.setting(name, 'lquote') + | ||
this.setting(name, 'lquote2') + | ||
this.setting(name, 'lquote3') + | ||
'])', | ||
re = new RegExp('([\\d' + this.letters() + '\\-\u0301!?.:;,]+)( |\u00A0)(' + lquotes + ')', 'gi'), | ||
re2 = new RegExp('(^|\n|' + Typograf._privateLabel + ')' + lquotes, 'g'); | ||
re = new RegExp('([\\d' + this._data('l') + '\\-\u0301!?.:;,]+)( |\u00A0)(' + lquotes + ')', 'gi'), | ||
re2 = new RegExp('(^|' + Typograf._privateLabel + ')' + lquotes, 'gm'); | ||
return text | ||
.replace(re, '$1<span class="typograf-oa-sp-lquot">$2</span><span class="typograf-oa-lquot">$3</span>') | ||
.replace(re2, '$1<span class="typograf-oa-n-lquot">$2</span>'); | ||
.replace(re, '$1<span class="typograf-oa-sp-lquote">$2</span><span class="typograf-oa-lquote">$3</span>') | ||
.replace(re2, '$1<span class="typograf-oa-n-lquote">$2</span>'); | ||
}, | ||
@@ -1875,6 +1868,6 @@ disabled: true | ||
.innerRule({ | ||
name: 'ru/optalign/quot', | ||
name: 'ru/optalign/quote', | ||
handler: function(text) { | ||
// Зачистка HTML-тегов от висячей пунктуации для кавычки | ||
return text.replace(/<span class="typograf-oa-(sp-lquot|lquot|n-lquot)">(.*?)<\/span>/g, '$2'); | ||
return text.replace(/<span class="typograf-oa-(n-|sp-)?lquote">(.*?)<\/span>/g, '$2'); | ||
} | ||
@@ -1885,3 +1878,2 @@ }); | ||
name: 'ru/other/accent', | ||
index: 560, | ||
handler: function(text) { | ||
@@ -1897,3 +1889,2 @@ return text.replace(/([а-яё])([АЕЁИОУЫЭЮЯ])([^А-ЯЁ\w]|$)/g, function($0, $1, $2, $3) { | ||
name: 'ru/punctuation/ano', | ||
index: 1110, | ||
handler: function(text) { | ||
@@ -1907,5 +1898,5 @@ var re = new RegExp('([^!?,:;\\-‒–—])([ \u00A0\n])(а|но)(?= |\u00A0|\n)', 'g'); | ||
name: 'ru/punctuation/apostrophe', | ||
index: 695, | ||
index: '-5', | ||
handler: function(text) { | ||
var letters = '([' + this.letters() + '])', | ||
var letters = '([' + this._data('l') + '])', | ||
re = new RegExp(letters + '[\'’]' + letters, 'gi'); | ||
@@ -1918,6 +1909,24 @@ | ||
Typograf.rule({ | ||
name: 'ru/punctuation/hellip', | ||
index: 20, | ||
name: 'ru/punctuation/exclamation', | ||
live: false, | ||
handler: function(text) { | ||
return text | ||
.replace(/(^|[^!])!{2}($|[^!])/, '$1!$2') | ||
.replace(/(^|[^!])!{4}($|[^!])/, '$1!!!$2'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/punctuation/exclamationQuestion', | ||
index: '+5', | ||
handler: function(text) { | ||
var re = new RegExp('(^|[^!])!\\?([^?]|$)', 'g'); | ||
return text.replace(re, '$1?!$2'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/punctuation/hellip', | ||
handler: function(text) { | ||
return text | ||
.replace(/(^|[^.])\.{3,4}([^.]|$)/g, '$1…$2') | ||
@@ -1930,26 +1939,25 @@ .replace(/(^|[^.])(\.\.\.|…),/g, '$1…') | ||
Typograf.rule({ | ||
name: 'ru/punctuation/quot', | ||
index: 700, | ||
name: 'ru/punctuation/quote', | ||
handler: function(text, settings) { | ||
var lquot = settings.lquot, | ||
rquot = settings.rquot; | ||
var lquote = settings.lquote, | ||
rquote = settings.rquote; | ||
text = Typograf._quot.call(this, text, settings); | ||
if(lquot === settings.lquot2 && rquot === settings.rquot2) { | ||
text = this._quote(text, settings); | ||
if(lquote === settings.lquote2 && rquote === settings.rquote2) { | ||
return text | ||
// ««Энергия» Синергия» -> «Энергия» Синергия» | ||
.replace(new RegExp(lquot + lquot, 'g'), lquot) | ||
.replace(new RegExp(lquote + lquote, 'g'), lquote) | ||
// «Энергия «Синергия»» -> «Энергия «Синергия» | ||
.replace(new RegExp(rquot + rquot, 'g'), rquot); | ||
.replace(new RegExp(rquote + rquote, 'g'), rquote); | ||
} | ||
return text; | ||
}, | ||
settings: { | ||
lquot: '«', | ||
rquot: '»', | ||
lquot2: '„', | ||
rquot2: '“', | ||
lquot3: '‚', | ||
rquot3: '‘' | ||
lquote: '«', | ||
rquote: '»', | ||
lquote2: '„', | ||
rquote2: '“', | ||
lquote3: '‚', | ||
rquote3: '‘' | ||
} | ||
@@ -1959,7 +1967,15 @@ }); | ||
Typograf.rule({ | ||
name: 'ru/space/afterHellip', | ||
handler: function(text) { | ||
return text | ||
.replace(/([а-яё])(\.\.\.|…)([А-ЯЁ])/g, '$1$2 $3') | ||
.replace(/([?!]\.\.)([а-яёa-z])/gi, '$1 $2'); | ||
} | ||
}); | ||
Typograf.rule({ | ||
name: 'ru/space/year', | ||
index: 600, | ||
handler: function(text) { | ||
var re = new RegExp('(^| |\u00A0)(\\d{3,4})(год([ауе]|ом)?)([^' + | ||
this.letters() + ']|$)', 'g'); | ||
this._data('l') + ']|$)', 'g'); | ||
return text.replace(re, '$1$2 $3$5'); | ||
@@ -1966,0 +1982,0 @@ } |
/*! Typograf | © 2015 Denis Seleznev | https://github.com/typograf/typograf/ */ | ||
!function(e,n){"function"==typeof define&&define.amd?define("typograf",[],n):"object"==typeof exports?module.exports=n():e.Typograf=n()}(this,function(){"use strict";function e(e){this._prefs="object"==typeof e?e:{},this._prefs.live=this._prefs.live||!1,this._settings={},this._enabledRules={},this._replaceLabel=this._replaceLabel.bind(this),this._pasteLabel=this._pasteLabel.bind(this),this._initSafeTags(),this._rules.forEach(this._prepareRule,this),this._prefs.disable&&this.disable(this._prefs.disable),this._prefs.enable&&this.enable(this._prefs.enable)}return e.rule=function(n){return n.enabled=n.enabled===!1||n.disabled===!0?!1:!0,n._lang=n.name.split("/")[0],n.index=n.index||0,e.prototype._rules.push(n),e._needSortRules&&this._sortRules(),this},e.innerRule=function(n){return e.prototype._innerRules.push(n),n._lang=n.name.split("/")[0],n.index=n.index||0,e._needSortRules&&this._sortInnerRules(),this},e.data=function(n,r){if("string"==typeof n){if(1===arguments.length)return e._data[n];e._data[n]=r}else"object"==typeof n&&Object.keys(n).forEach(function(r){e._data[r]=n[r]})},e._data={},e._sortRules=function(){e.prototype._rules.sort(function(e,n){return e.index>n.index?1:-1})},e._sortInnerRules=function(){e.prototype._innerRules.sort(function(e,n){return e.index>n.index?1:-1})},e._replace=function(e,n){for(var r=0;r<n.length;r++)e=e.replace(n[r][0],n[r][1]);return e},e._quot=function(n,r){var a="\\d"+this.letters()+"\u0301",t=e._privateLabel,i=r.lquot,u=r.rquot,l=r.lquot2,o=r.rquot2,s="["+e.data("common/quot")+"]",c="["+a+")!?.:;#*,]*?",p=new RegExp('"([\u2026'+a+"])","gi"),d=new RegExp("("+c+')"('+c+")","gi"),h=new RegExp(s,"g"),g=new RegExp("^(\\s)?("+s+")","g"),m=new RegExp("(^|\\s)"+s+t,"g"),f=new RegExp(t+s+"([\\s!?.:;#*,]|$)","g"),$=0;return n=n.replace(h,function(){return $++,'"'}).replace(p,i+"$1").replace(d,"$1"+u+"$2").replace(m,"$1"+i+t).replace(f,t+u+"$1").replace(g,"$1"+i),l&&o&&$%2===0?e._innerQuot(n,r):n},e._innerQuot=function(e,n){var r=[n.lquot],a=[n.rquot],t=n.lquot,i=n.rquot,u=new Array(e.length);n.lquot2&&n.rquot2&&(r.push(n.lquot2),a.push(n.rquot2),n.lquot3&&n.rquot3&&(r.push(n.lquot3),a.push(n.rquot3)));for(var l=-1,o=r.length-1,s=0,c=e.length;c>s;s++){var p=e[s];p===t?(l++,l>o&&(l=o),u.push(r[l])):p===i?-1>=l?(l=0,u.push(r[l])):(u.push(a[l]),l--,-1>l&&(l=-1)):u.push(p)}return u.join("")},e._langs=["en","ru"],e._privateLabel="\udbff",e.prototype={constructor:e,execute:function(e,n){n=n||{};var r=this,a=n.lang||this._prefs.lang||"common",t={},i={},u="undefined"==typeof n.mode?this._prefs.mode:n.mode,l=function(n){var r=n._lang,t=this._prefs.live;t===!0&&n.live===!1||t===!1&&n.live===!0||"common"!==r&&r!==a||!this.enabled(n.name)||(this._onBeforeRule&&this._onBeforeRule(e),e=n.handler.call(this,e,this._settings[n.name]),this._onAfterRule&&this._onAfterRule(e))},o=function(e){i[e]&&i[e].forEach(l,r),t[e]&&t[e].forEach(l,r)};return this._lang=a,(e=""+e)?(e=this._fixLineEnd(e),this._innerRules.forEach(function(e){var n=e.queue;i[n]=i[n]||[],i[n].push(e)},this),this._rules.forEach(function(e){var n=e.queue;t[n]=t[n]||[],t[n].push(e)},this),this._isHTML=-1!==e.search(/(<\/?[a-z]|<!|&[lg]t;)/i),o("start"),this._isHTML&&(e=this._hideSafeTags(e)),e=this._utfication(e),o("utf"),o(),e=this._modification(e,u),this._isHTML&&(e=this._showSafeTags(e)),o("end"),this._lang=null,this._isHTML=null,e):""},setting:function(e,n,r){return arguments.length<=2?this._settings[e]&&this._settings[e][n]:(this._settings[e]=this._settings[e]||{},this._settings[e][n]=r,this)},enabled:function(e){return this._enabledRules[e]},disabled:function(e){return!this._enabledRules[e]},enable:function(e){return this._enable(e,!0)},disable:function(e){return this._enable(e,!1)},addSafeTag:function(e,n){this._safeTags.push([e,n])},letters:function(){var n=this._lang||this._prefs.lang,r=e.data("common/letter"),a=e.data(n+"/letter");return r!==a&&n?r+a:r},_fixLineEnd:function(e){return e.replace(/\r\n/g,"\n")},_prepareRule:function(e){var n=e.name,r={};"object"==typeof e.settings&&Object.keys(e.settings).forEach(function(n){r[n]=e.settings[n]}),this._settings[n]=r,this._enabledRules[n]=e.enabled},_enable:function(e,n){return Array.isArray(e)?e.forEach(function(e){this._enableByMask(e,n)},this):this._enableByMask(e,n),this},_enableByMask:function(e,n){var r;-1!==e.search(/\*/)?(r=new RegExp(e.replace(/\//g,"\\/").replace(/\*/g,".*")),this._rules.forEach(function(e){var a=e.name;r.test(a)&&(this._enabledRules[a]=n)},this)):this._enabledRules[e]=n},_rules:[],_innerRules:[],_getRule:function(e){var n=null;return this._rules.some(function(r){return r.name===e?(n=r,!0):!1}),n},_initSafeTags:function(){this._safeTags=[["<!--","-->"],["<!ENTITY",">"],["<!DOCTYPE",">"],["<\\?xml","\\?>"],["<!\\[CDATA\\[","\\]\\]>"]],["code","kbd","object","pre","samp","script","style","var"].forEach(function(e){this._safeTags.push(["<"+e+"(\\s[^>]*?)?>","</"+e+">"])},this)},_hideSafeTags:function(e){return this._hiddenSafeTags={},this._iLabel=0,this._safeTags.forEach(function(n){var r=new RegExp(n[0]+"[^]*?"+n[1],"gi");e=e.replace(r,this._pasteLabel)},this),this._hideHTMLTags(e)},_getPrivateLabel:function(n){var r=e._privateLabel;return r+"tf"+n+r},_pasteLabel:function(e){var n=this._getPrivateLabel(this._iLabel);return this._hiddenSafeTags[n]=e,this._iLabel++,n},_replaceLabel:function(e){return this._hiddenSafeTags[e]},_hideHTMLTags:function(e){return e.replace(/<\/?[a-z][^]*?>/gi,this._pasteLabel).replace(/<\/?[a-z][^]*?>/gi,this._pasteLabel).replace(/&[gl]t;/gi,this._pasteLabel)},_showSafeTags:function(n){for(var r=e._privateLabel,a=new RegExp(r+"tf\\d+"+r,"g"),t=new RegExp(r+"tf\\d"),i=0;i<this._safeTags.length&&(n=n.replace(a,this._replaceLabel),-1!==n.search(t));i++);return delete this._hiddenSafeTags,n},_utfication:function(e){return-1!==e.search(/&#/)&&(e=this._decHexToUtf(e)),-1!==e.search(/&[a-z]/i)&&this.entities.forEach(function(n){e=e.replace(n[3],n[2])}),e.replace(/"/g,'"')},_decHexToUtf:function(e){return e.replace(/&#(\d{1,6});/gi,function(e,n){return String.fromCharCode(parseInt(n,10))}).replace(/&#x([\da-f]{1,6});/gi,function(e,n){return String.fromCharCode(parseInt(n,16))})},_modification:function(e,n){if("name"===n||"digit"===n){var r="name"===n?0:1;this.entities.forEach(function(n){n[r]&&(e=e.replace(n[4],n[r]))})}return e}},e.prototype.entities=[],[["nbsp",160],["iexcl",161],["cent",162],["pound",163],["curren",164],["yen",165],["brvbar",166],["sect",167],["uml",168],["copy",169],["ordf",170],["laquo",171],["not",172],["shy",173],["reg",174],["macr",175],["deg",176],["plusmn",177],["sup2",178],["sup3",179],["acute",180],["micro",181],["para",182],["middot",183],["cedil",184],["sup1",185],["ordm",186],["raquo",187],["frac14",188],["frac12",189],["frac34",190],["iquest",191],["Agrave",192],["Aacute",193],["Acirc",194],["Atilde",195],["Auml",196],["Aring",197],["AElig",198],["Ccedil",199],["Egrave",200],["Eacute",201],["Ecirc",202],["Euml",203],["Igrave",204],["Iacute",205],["Icirc",206],["Iuml",207],["ETH",208],["Ntilde",209],["Ograve",210],["Oacute",211],["Ocirc",212],["Otilde",213],["Ouml",214],["times",215],["Oslash",216],["Ugrave",217],["Uacute",218],["Ucirc",219],["Uuml",220],["Yacute",221],["THORN",222],["szlig",223],["agrave",224],["aacute",225],["acirc",226],["atilde",227],["auml",228],["aring",229],["aelig",230],["ccedil",231],["egrave",232],["eacute",233],["ecirc",234],["euml",235],["igrave",236],["iacute",237],["icirc",238],["iuml",239],["eth",240],["ntilde",241],["ograve",242],["oacute",243],["ocirc",244],["otilde",245],["ouml",246],["divide",247],["oslash",248],["ugrave",249],["uacute",250],["ucirc",251],["uuml",252],["yacute",253],["thorn",254],["yuml",255],["fnof",402],["Alpha",913],["Beta",914],["Gamma",915],["Delta",916],["Epsilon",917],["Zeta",918],["Eta",919],["Theta",920],["Iota",921],["Kappa",922],["Lambda",923],["Mu",924],["Nu",925],["Xi",926],["Omicron",927],["Pi",928],["Rho",929],["Sigma",931],["Tau",932],["Upsilon",933],["Phi",934],["Chi",935],["Psi",936],["Omega",937],["alpha",945],["beta",946],["gamma",947],["delta",948],["epsilon",949],["zeta",950],["eta",951],["theta",952],["iota",953],["kappa",954],["lambda",955],["mu",956],["nu",957],["xi",958],["omicron",959],["pi",960],["rho",961],["sigmaf",962],["sigma",963],["tau",964],["upsilon",965],["phi",966],["chi",967],["psi",968],["omega",969],["thetasym",977],["upsih",978],["piv",982],["bull",8226],["hellip",8230],["prime",8242],["Prime",8243],["oline",8254],["frasl",8260],["weierp",8472],["image",8465],["real",8476],["trade",8482],["alefsym",8501],["larr",8592],["uarr",8593],["rarr",8594],["darr",8595],["harr",8596],["crarr",8629],["lArr",8656],["uArr",8657],["rArr",8658],["dArr",8659],["hArr",8660],["forall",8704],["part",8706],["exist",8707],["empty",8709],["nabla",8711],["isin",8712],["notin",8713],["ni",8715],["prod",8719],["sum",8721],["minus",8722],["lowast",8727],["radic",8730],["prop",8733],["infin",8734],["ang",8736],["and",8743],["or",8744],["cap",8745],["cup",8746],["int",8747],["there4",8756],["sim",8764],["cong",8773],["asymp",8776],["ne",8800],["equiv",8801],["le",8804],["ge",8805],["sub",8834],["sup",8835],["nsub",8836],["sube",8838],["supe",8839],["oplus",8853],["otimes",8855],["perp",8869],["sdot",8901],["lceil",8968],["rceil",8969],["lfloor",8970],["rfloor",8971],["lang",9001],["rang",9002],["spades",9824],["clubs",9827],["hearts",9829],["diams",9830],["loz",9674],["OElig",338],["oelig",339],["Scaron",352],["scaron",353],["Yuml",376],["circ",710],["tilde",732],["ensp",8194],["emsp",8195],["thinsp",8201],["zwnj",8204],["zwj",8205],["lrm",8206],["rlm",8207],["ndash",8211],["mdash",8212],["lsquo",8216],["rsquo",8217],["sbquo",8218],["ldquo",8220],["rdquo",8221],["bdquo",8222],["dagger",8224],["Dagger",8225],["permil",8240],["lsaquo",8249],["rsaquo",8250],["euro",8364],["NestedGreaterGreater",8811],["NestedLessLess",8810]].forEach(function(n){var r=n[0],a=n[1],t=String.fromCharCode(a),i=["&"+r+";","&#"+a+";",t,new RegExp("&"+r+";","g"),new RegExp(t,"g")];e.prototype.entities.push(i)},this),e.data("common/dash","--?|\u2012|\u2013|\u2014"),e.data("common/letter","a-z"),e.data("common/quot",'\xab\u2039\xbb\u203a\u201e\u201a\u201c\u201f\u2018\u201b\u201d\u2019"'),e.data("en/letter","a-z"),e.data("ru/dash",{before:"(^| |\\n)",after:"( |,|\\.|\\?|:|!|$)"}),e.data({"ru/letter":"\u0430-\u044f\u0451","ru/letterUpper":"\u0410-\u042f\u0401"}),e.data({"ru/month":["\u044f\u043d\u0432\u0430\u0440\u044c","\u0444\u0435\u0432\u0440\u0430\u043b\u044c","\u043c\u0430\u0440\u0442","\u0430\u043f\u0440\u0435\u043b\u044c","\u043c\u0430\u0439","\u0438\u044e\u043d\u044c","\u0438\u044e\u043b\u044c","\u0430\u0432\u0433\u0443\u0441\u0442","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u043e\u043a\u0442\u044f\u0431\u0440\u044c","\u043d\u043e\u044f\u0431\u0440\u044c","\u0434\u0435\u043a\u0430\u0431\u0440\u044c"],"ru/monthGenCase":["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f"],"ru/monthPreCase":["\u044f\u043d\u0432\u0430\u0440\u0435","\u0444\u0435\u0432\u0440\u0430\u043b\u0435","\u043c\u0430\u0440\u0442\u0435","\u0430\u043f\u0440\u0435\u043b\u0435","\u043c\u0430\u0435","\u0438\u044e\u043d\u0435","\u0438\u044e\u043b\u0435","\u0430\u0432\u0433\u0443\u0441\u0442\u0435","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u0435","\u043e\u043a\u0442\u044f\u0431\u0440\u0435","\u043d\u043e\u044f\u0431\u0440\u0435","\u0434\u0435\u043a\u0430\u0431\u0440\u0435"],"ru/shortMonth":["\u044f\u043d\u0432","\u0444\u0435\u0432","\u043c\u0430\u0440","\u0430\u043f\u0440","\u043c\u0430[\u0435\u0439\u044f]","\u0438\u044e\u043d","\u0438\u044e\u043b","\u0430\u0432\u0433","\u0441\u0435\u043d","\u043e\u043a\u0442","\u043d\u043e\u044f","\u0434\u0435\u043a"]}),e.data("ru/weekday",["\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430","\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435"]),e.rule({name:"common/html/escape",index:110,queue:"end",handler:function(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return e.replace(/[&<>"'\/]/g,function(e){return n[e]})},disabled:!0}),e.rule({name:"common/html/mail",index:2e3,handler:function(e){return e.replace(/(^|[\s;(])([\w\-.]{2,})@([\w\-.]{2,})\.([a-z]{2,6})([)\s.,!?]|$)/gi,'$1<a href="mailto:$2@$3.$4">$2@$3.$4</a>$5')},disabled:!0}),e.rule({name:"common/html/nbr",index:110,queue:"start",handler:function(e){return-1===e.search(/<br/)?e.replace(/\n/g,"<br/>\n"):e},disabled:!0}),e.rule({name:"common/html/pbr",index:90,queue:"end",handler:function(e){return-1===e.search(/<(p|br)[\s\/>]/)&&(-1===e.search(/\n/)?e="<p>"+e+"</p>":(e="<p>"+e.replace(/\n\n/g,"</p>\n<p>")+"</p>",e=e.replace(/([^>])\n/g,"$1<br/>\n"))),e},disabled:!0}),e.rule({name:"common/html/stripTags",index:100,queue:"end",handler:function(e){return e.replace(/<\/?[^>]+>/g,"")},disabled:!0}),e.rule({name:"common/html/url",index:2010,handler:function(e){var n="(http|https|ftp|telnet|news|gopher|file|wais)://",r="([a-zA-Z0-9/+-=%&:_.~?]+[a-zA-Z0-9#+]*)",a=new RegExp(n+r,"g");return e.replace(a,function(e,n,r){r=r.replace(/([^\/]+\/?)(\?|#)$/,"$1").replace(/^([^\/]+)\/$/,"$1"),"http"===n?r=r.replace(/^([^\/]+)(:80)([^\d]|\/|$)/,"$1$3"):"https"===n&&(r=r.replace(/^([^\/]+)(:443)([^\d]|\/|$)/,"$1$3"));var a=r,t=n+"://"+r,i='<a href="'+t+'">';return"http"===n||"https"===n?(a=a.replace(/^www\./,""),i+("http"===n?a:n+"://"+a)+"</a>"):i+t+"</a>"})},disabled:!0}),e.rule({name:"common/nbsp/afterNumber",index:615,handler:function(e){var n="(^|\\D)(\\d{1,5}) (["+this.letters()+"]{2,})";return e.replace(new RegExp(n,"gi"),"$1$2\xa0$3")}}),e.rule({name:"common/nbsp/afterPara",index:610,handler:function(e){return e.replace(/\xa7 ?(\d|I|V|X)/g,"\xa7\xa0$1")}}),e.rule({name:"common/nbsp/afterShortWord",index:590,handler:function(n,r){var a=r.lengthShortWord,t=" \xa0("+e._privateLabel+e.data("common/quot"),i="(^|["+t+"])(["+this.letters()+"]{1,"+a+"}) ",u="$1$2\xa0",l=new RegExp(i,"gim");return n.replace(l,u).replace(l,u)},settings:{lengthShortWord:2}}),e.rule({name:"common/nbsp/beforeShortLastWord",index:620,handler:function(e,n){var r=".,?!:;",a=new RegExp("([^"+r+"]) (["+this.letters()+"]{1,"+n.lengthLastWord+"}["+r+"\n])","gi");return e.replace(a,"$1\xa0$2")},settings:{lengthLastWord:3}}),e.rule({name:"common/nbsp/dpi",index:1150,handler:function(e){return e.replace(/(\d) ?(lpi|dpi)(?!\w)/,"$1\xa0$2")}}),function(){function n(e,n,r,a){return n+r.replace(/([^\u00A0])\u00A0([^\u00A0])/g,"$1 $2")+a}e.rule({name:"common/nbsp/nowrap",index:100,queue:"start",handler:function(e){return e.replace(/(<nowrap>)(.*?)(<\/nowrap>)/g,n).replace(/(<nobr>)(.*?)(<\/nobr>)/g,n)}})}(),e.rule({name:"common/nbsp/replaceNbsp",queue:"utf",live:!0,handler:function(e){return e.replace(/\u00A0/g," ")}}),e.rule({name:"common/number/fraction",index:1120,handler:function(e){return e.replace(/(^|\D)1\/2(\D|$)/g,"$1\xbd$2").replace(/(^|\D)1\/4(\D|$)/g,"$1\xbc$2").replace(/(^|\D)3\/4(\D|$)/g,"$1\xbe$2")}}),e.rule({name:"common/number/mathSigns",index:1010,handler:function(n){return e._replace(n,[[/!=/g,"\u2260"],[/<=/g,"\u2264"],[/(^|[^=])>=/g,"$1\u2265"],[/<=>/g,"\u21d4"],[/<</g,"\u226a"],[/>>/g,"\u226b"],[/~=/g,"\u2245"],[/\+-/g,"\xb1"]])}}),e.rule({name:"common/number/times",index:1050,handler:function(e){return e.replace(/(\d)[ \u00A0]?(x|\u0445)[ \u00A0]?(\d)/g,"$1\xd7$3")}}),e.rule({name:"common/other/delBOM",queue:"start",handler:function(e){return 65279===e.charCodeAt(0)?e.slice(1):e}}),e.rule({name:"common/other/repeatWord",index:1200,handler:function(e){var n="(["+this.letters()+"\u0301]+) \\1([;:,.?! \n])";return e.replace(new RegExp(n,"gi"),"$1$2")},disabled:!0}),e.rule({name:"common/punctuation/delDoublePunctuation",index:580,handler:function(e){return e.replace(/(^|[^,]),,(?!,)/g,"$1,").replace(/(^|[^:])::(?!:)/g,"$1:").replace(/(^|[^!?\.])\.\.(?!\.)/g,"$1.").replace(/(^|[^;]);;(?!;)/g,"$1;").replace(/(^|[^?])\?\?(?!\?)/g,"$1?")}}),e.rule({name:"common/punctuation/exclamation",index:1140,live:!1,handler:function(e){return e.replace(/(^|[^!])!{2}($|[^!])/,"$1!$2").replace(/(^|[^!])!{4}($|[^!])/,"$1!!!$2")}}),e.rule({name:"common/punctuation/exclamationQuestion",index:1150,handler:function(e){var n=new RegExp("(^|[^!])!\\?([^?]|$)","g");return e.replace(n,"$1?!$2")}}),e.rule({name:"common/space/afterPunctuation",index:560,handler:function(n){var r=e._privateLabel,a=new RegExp("(!|;|\\?)([^.!;?\\s[\\])"+r+e.data("common/quot")+"])","g"),t=new RegExp("(\\D)(,|:)([^,:.?\\s\\/"+r+"])","g");return n.replace(a,"$1 $2").replace(t,"$1$2 $3")}}),e.rule({name:"common/space/beforeBracket",index:560,handler:function(e){var n=new RegExp("(["+this.letters()+".!?,;\u2026)])\\(","gi");return e.replace(n,"$1 (")}}),e.rule({name:"common/space/bracket",index:560,handler:function(e){return e.replace(/(\() +/g,"(").replace(/ +\)/g,")")}}),e.rule({name:"common/space/delBeforePercent",index:600,handler:function(e){return e.replace(/(\d)( |\u00A0)(%|\u2030|\u2031)/g,"$1$3")}}),e.rule({name:"common/space/delBeforePunctuation",index:550,handler:function(e){return e.replace(/ ([!;,?.:])/g,"$1")}}),e.rule({name:"common/space/delLeadingBlanks",index:504,handler:function(e){return e.replace(/\n[ \t]+/g,"\n")},disabled:!0}),e.rule({name:"common/space/delRepeatN",index:545,handler:function(e){return e.replace(/\n{3,}/g,"\n\n")}}),e.rule({name:"common/space/delRepeatSpace",index:540,handler:function(e){return e.replace(/([^\n \t])( |\t){2,}([^\n \t])/g,"$1$2$3")}}),e.rule({name:"common/space/delTrailingBlanks",index:505,handler:function(e){return e.replace(/[ \t]+\n/g,"\n")}}),e.rule({name:"common/space/replaceTab",index:510,handler:function(e){return e.replace(/\t/g," ")}}),e.rule({name:"common/space/squareBracket",index:560,handler:function(e){return e.replace(/(\[) +/g,"[").replace(/ +\]/g,"]")}}),e.rule({name:"common/space/trimLeft",index:530,handler:String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^[\s\uFEFF\xA0]+/g,"")}}),e.rule({name:"common/space/trimRight",index:535,live:!1,handler:String.prototype.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/[\s\uFEFF\xA0]+$/g,"")}}),e.rule({name:"common/sym/arrow",index:1130,handler:function(n){return e._replace(n,[[/(^|[^-])->(?!>)/g,"$1\u2192"],[/(^|[^<])<-(?!-)/g,"$1\u2190"]])}}),e.rule({name:"common/sym/cf",index:1020,handler:function(e){var n=new RegExp('(\\d+)( |\xa0)?(C|F)([\\W \\.,:!\\?"\\]\\)]|$)',"g");return e.replace(n,"$1\u2009\xb0$3$4")}}),e.rule({name:"common/sym/copy",index:10,handler:function(n){return e._replace(n,[[/\(r\)/gi,"\xae"],[/(copyright )?\((c|\u0441)\)/gi,"\xa9"],[/\(tm\)/gi,"\u2122"]])}}),e.rule({name:"en/punctuation/quot",index:700,handler:e._quot,settings:{lquot:"\u201c",rquot:"\u201d",lquot2:"\u2018",rquot2:"\u2019"}}),e.rule({name:"ru/dash/izpod",index:35,handler:function(n){var r=e.data("ru/dash"),a=new RegExp(r.before+"(\u0418|\u0438)\u0437 \u043f\u043e\u0434"+r.after,"g");return n.replace(a,"$1$2\u0437-\u043f\u043e\u0434$3")}}),e.rule({name:"ru/dash/izza",index:33,handler:function(n){var r=e.data("ru/dash"),a=new RegExp(r.before+"(\u0418|\u0438)\u0437 \u0437\u0430"+r.after,"g");return n.replace(a,"$1$2\u0437-\u0437\u0430$3")}}),e.rule({name:"ru/dash/kade",index:31,handler:function(n){var r=new RegExp("([a-\u044f\u0451]+)( | ?- ?)(\u043a\u0430|\u0434\u0435|\u043a\u0430\u0441\u044c)"+e.data("ru/dash").after,"g");return n.replace(r,"$1-$3$4")}}),e.rule({name:"ru/dash/koe",index:38,handler:function(n){var r=e.data("ru/dash"),a=new RegExp(r.before+"([\u041a\u043a]\u043e[\u0435\u0439])\\s([\u0430-\u044f\u0451]{3,})"+r.after,"g");return n.replace(a,"$1$2-$3$4")}}),e.rule({name:"ru/dash/main",index:620,handler:function(n){var r="ru/dash/main",a=this.setting(r,"dash"),t="("+e.data("common/dash")+")",i=e.data("ru/letter"),u=new RegExp("( |\xa0)"+t+"( |\\n)","g"),l=new RegExp('(["\xbb\u2018\u201c,.\u2026?!])[ |\xa0]?'+t+"[ |\xa0]","g"),o=new RegExp("(^|"+e._privateLabel+")"+t+"( |\xa0)","gm"),s=new RegExp("(X|I|V)[ |\xa0]?"+t+"[ |\xa0]?(X|I|V)","g"),c=new RegExp("(["+e.data("ru/letterUpper")+"]["+i+"]+)\\s-(["+i+"]{1,3})(?![^"+i+"]|$)","g");return n.replace(u,"\xa0"+a+"$3").replace(l,"$1 "+a+"\xa0").replace(o,"$1"+a+"\xa0").replace(s,"$1"+this.setting(r,"dashInterval")+"$3").replace(c,"$1\xa0"+a+"$2")},settings:{dash:"\u2014",dashInterval:"\u2014"}}),e.rule({name:"ru/dash/month",index:610,handler:function(n){var r="("+e.data("ru/month").join("|")+")",a="("+e.data("ru/monthPreCase").join("|")+")",t=e.data("common/dash"),i=this.setting("ru/dash/main","dashInterval"),u=new RegExp(r+" ?("+t+") ?"+r,"gi"),l=new RegExp(a+" ?("+t+") ?"+a,"gi");return n.replace(u,"$1"+i+"$3").replace(l,"$1"+i+"$3")}}),e.rule({name:"ru/dash/taki",index:39,handler:function(n){var r=new RegExp("(\u0432\u0435\u0440\u043d\u043e|\u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e|\u043e\u043f\u044f\u0442\u044c|\u043f\u0440\u044f\u043c\u043e|\u0442\u0430\u043a|\u0432\u0441[\u0435\u0451]|\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e|\u043d\u0435\u0443\u0436\u0435\u043b\u0438)\\s(\u0442\u0430\u043a\u0438)"+e.data("ru/dash").after,"g");return n.replace(r,"$1-$2$3")}}),e.rule({name:"ru/dash/to",index:30,handler:function(n){var r=["\u043e\u0442\u043a\u0443\u0434\u0430","\u043a\u0443\u0434\u0430","\u0433\u0434\u0435","\u043a\u043e\u0433\u0434\u0430","\u0437\u0430\u0447\u0435\u043c","\u043f\u043e\u0447\u0435\u043c\u0443","\u043a\u0430\u043a","\u043a\u0430\u043a\u043e[\u0435\u0439\u043c]","\u043a\u0430\u043a\u0430\u044f","\u043a\u0430\u043a\u0438[\u0435\u043c\u0445]","\u043a\u0430\u043a\u0438\u043c\u0438","\u043a\u0430\u043a\u0443\u044e","\u0447\u0442\u043e","\u0447\u0435\u0433\u043e","\u0447\u0435[\u0439\u043c]","\u0447\u044c\u0438\u043c?","\u043a\u0442\u043e","\u043a\u043e\u0433\u043e","\u043a\u043e\u043c\u0443","\u043a\u0435\u043c"],a=new RegExp("("+r.join("|")+")( | ?- ?)(\u0442\u043e|\u043b\u0438\u0431\u043e|\u043d\u0438\u0431\u0443\u0434\u044c)"+e.data("ru/dash").after,"gi");return n.replace(a,"$1-$3$4")}}),e.rule({name:"ru/dash/weekday",index:600,handler:function(n){var r="("+e.data("ru/weekday").join("|")+")",a=new RegExp(r+" ?("+e.data("common/dash")+") ?"+r,"gi");return n.replace(a,"$1"+this.setting("ru/dash/main","dashInterval")+"$3")}}),e.rule({name:"ru/date/main",index:1300,handler:function(e){var n="(-|\\.|\\/)",r="(-|\\/)",a=new RegExp("(^|\\D)(\\d{4})"+n+"(\\d{2})"+n+"(\\d{2})(\\D|$)","gi"),t=new RegExp("(^|\\D)(\\d{2})"+r+"(\\d{2})"+r+"(\\d{4})(\\D|$)","gi");return e.replace(a,"$1$6.$4.$2$7").replace(t,"$1$4.$2.$6$7")}}),e.rule({name:"ru/date/weekday",index:1310,handler:function(n){var r="( |\xa0)",a=e.data("ru/monthGenCase").join("|"),t=e.data("ru/weekday").join("|"),i=new RegExp("(\\d)"+r+"("+a+"),"+r+"("+t+")","gi");return n.replace(i,function(){var e=arguments;return e[1]+e[2]+e[3].toLowerCase()+","+e[4]+e[5].toLowerCase()})}}),e.rule({name:"ru/money/dollar",index:1140,handler:function(e){var n=new RegExp("(^|[\\D]{2,})\\$ ?([\\d.,]+)","g"),r=new RegExp("(^|[\\D])([\\d.,]+) ?\\$","g"),a="$1$2\xa0$";return e.replace(n,a).replace(r,a)}}),e.rule({name:"ru/money/euro",index:1140,handler:function(e){var n=new RegExp("(^|[\\D]{2,})\u20ac ?([\\d.]+)","g"),r=new RegExp("(^|[\\D])([\\d.,]+) ?\u20ac","g"),a="$1$2\xa0\u20ac";return e.replace(n,a).replace(r,a)}}),e.rule({name:"ru/money/ruble",index:1145,handler:function(e){var n="$1\xa0\u20bd";return e.replace(/^(\d+)( |\u00A0)?(\u0440|\u0440\u0443\u0431)\.$/,n).replace(/(\d+)( |\u00A0)?(\u0440|\u0440\u0443\u0431)\.(?=[!?,:;])/g,n).replace(/(\d+)( |\u00A0)?(\u0440|\u0440\u0443\u0431)\.(?=\s+[A-\u042f\u0401])/g,n+".")},disabled:!0}),e.rule({name:"ru/nbsp/abbr",index:565,handler:function(n){var r=new RegExp("(^|\\s|"+e._privateLabel+")(([\u0430-\u044f\u0451]{1,3}\\.){2,})(?![\u0430-\u044f\u0451])","g");return n.replace(r,function(e,n,r){var a=r.split(/\./);return["\u0440\u0444","\u0440\u0443","\u0440\u0443\u0441","\u043e\u0440\u0433","\u0443\u043a\u0440","\u0431\u0433","\u0441\u0440\u0431"].indexOf(a[a.length-2])>-1?e:n+r.split(/\./).join(".\xa0").trim()})}}),e.rule({name:"ru/nbsp/addr",index:1115,handler:function(e){return e.replace(/(\s|^)(\u0434\u043e\u043c|\u0434\.|\u043a\u0432\.|\u043f\u043e\u0434\.|\u043f\-\u0434) *(\d+)/gi,"$1$2\xa0$3").replace(/(\s|^)(\u043c\u043a\u0440-\u043d|\u043c\u043a-\u043d|\u043c\u043a\u0440\.|\u043c\u043a\u0440\u043d)\s/gi,"$1$2\xa0").replace(/(\s|^)(\u044d\u0442\.) *(-?\d+)/gi,"$1$2\xa0$3").replace(/(\s|^)(\d+) +\u044d\u0442\u0430\u0436([^\u0430-\u044f\u0451]|$)/gi,"$1$2\xa0\u044d\u0442\u0430\u0436$3").replace(/(\s|^)\u043b\u0438\u0442\u0435\u0440\s([\u0410-\u042f]|$)/gi,"$1\u043b\u0438\u0442\u0435\u0440\xa0$2").replace(/(\s|^)(\u043e\u0431\u043b|\u043a\u0440|\u0433|\u0441\u0442|\u043f\u043e\u0441|\u0441|\u0434|\u0443\u043b|\u043f\u0435\u0440|\u043f\u0440|\u043f\u0440\-\u0442|\u043f\u0440\u043e\u0441\u043f|\u043f\u043b|\u0431\u0443\u043b|\u0431\-\u0440|\u043d\u0430\u0431|\u0448|\u0442\u0443\u043f|\u043e\u0444|\u043a\u043e\u043c\u043d?|\u0443\u0447|\u0432\u043b|\u0432\u043b\u0430\u0434|\u0441\u0442\u0440|\u043a\u043e\u0440)\. *([\u0430-\u044f\u0451a-z\d]+)/gi,"$1$2.\xa0$3")}}),e.rule({name:"ru/nbsp/afterNumberSign",index:610,handler:function(e){return e.replace(/\u2116 ?(\d|\u043f\/\u043f)/g,"\u2116\xa0$1")}}),e.rule({name:"ru/nbsp/beforeParticle",index:600,handler:function(e){var n="(\u043b\u0438|\u043b\u044c|\u0436\u0435|\u0436|\u0431\u044b|\u0431)",r=new RegExp(" "+n+'(?=[?!,.:;"\u2018\u201c\xbb])',"g"),a=new RegExp("[ \xa0]"+n+"[ \xa0]","g");return e.replace(r,"\xa0$1").replace(a,"\xa0$1 ")}}),e.rule({name:"ru/nbsp/cc",index:1090,handler:function(e){return e=e.replace(/(^|\d|V|I|X) ?\u0432(\u0432)?( |,|;|\n|$)/g,"$1\xa0\u0432$2.$3"),e.replace(/(^|\d|[IVX]) ?\u0432\.? ?\u0432\./g,"$1\xa0\u0432\u0432.")}}),e.rule({name:"ru/nbsp/dayMonth",index:1105,handler:function(n){var r=new RegExp("(\\d{1,2}) ("+e.data("ru/shortMonth").join("|")+")","gi");return n.replace(r,"$1\xa0$2")}}),e.rule({name:"ru/nbsp/m",index:1030,handler:function(n){var r=e._privateLabel,a=new RegExp("(^|[\\s,."+r+"])(\\d+)[ \xa0]?(\u043c\u043c?|\u0441\u043c|\u043a\u043c|\u0434\u043c|\u0433\u043c|mm?|km|cm|dm)([23\xb2\xb3])?([\\s.!?,;"+r+"]|$)","gm");return n.replace(a,function(e,n,r,a,t,i){var u={2:"\xb2","\xb2":"\xb2",3:"\xb3","\xb3":"\xb3","":""}[t||""];return n+r+"\xa0"+a+u+("\xa0"===i?" ":i)})}}),e.rule({name:"ru/nbsp/ooo",index:1100,handler:function(e){return e.replace(/(^|[^a-\u044f\u0451A-\u042f\u0401])(\u041e\u041e\u041e|\u041e\u0410\u041e|\u0417\u0410\u041e|\u041d\u0418\u0418|\u041f\u0411\u041e\u042e\u041b) /g,"$1$2\xa0")}}),e.rule({name:"ru/nbsp/page",index:610,handler:function(n){var r=new RegExp("(^|[)\\s"+e._privateLabel+"])(\u0441\u0442\u0440|\u0433\u043b|\u0440\u0438\u0441|\u0438\u043b\u043b?|\u0441\u0442|\u043f|c)\\. *(\\d+)([\\s.,?!;:]|$)","gim");return n.replace(r,"$1$2.\xa0$3$4")}}),e.rule({name:"ru/nbsp/ps",index:565,handler:function(n){var r=new RegExp("(^|\\s|"+e._privateLabel+")[p\u0437]\\.[ \xa0]?([p\u0437]\\.[ \xa0]?)?[s\u044b]\\.:? ","gim");return n.replace(r,function(e,n,r){return n+(r?"P.\xa0P.\xa0S. ":"P.\xa0S. ")})}}),e.rule({name:"ru/nbsp/xxxx",index:1060,handler:function(e){return e.replace(/(^|\D)(\d{1,4}) ?\u0433(\u043e\u0434| |,|;|\.|\n|$)/g,"$1$2\xa0\u0433$3")}}),e.rule({name:"ru/nbsp/yy",index:1080,handler:function(e){return e.replace(/(^|\d) ?\u0433\. ?\u0433\./g,"$1\xa0\u0433\u0433.")}}),e.rule({name:"ru/number/ordinals",index:1300,handler:function(e){var n=new RegExp("(\\d)-(\u044b\u0439|\u043e\u0439|\u0430\u044f|\u043e\u0435|\u044b\u0435|\u044b\u043c|\u043e\u043c|\u044b\u0445|\u043e\u0433\u043e|\u043e\u043c\u0443|\u044b\u043c\u0438)(?!["+this.letters()+"])","g");return e.replace(n,function(e,n,r){var a={"\u043e\u0439":"\u0439","\u044b\u0439":"\u0439","\u0430\u044f":"\u044f","\u043e\u0435":"\u0435","\u044b\u0435":"\u0435","\u044b\u043c":"\u043c","\u043e\u043c":"\u043c","\u044b\u0445":"\u0445","\u043e\u0433\u043e":"\u0433\u043e","\u043e\u043c\u0443":"\u043c\u0443","\u044b\u043c\u0438":"\u043c\u0438"};return n+"-"+a[r]})}}),e.rule({name:"ru/optalign/bracket",index:1001,handler:function(e,n){return e.replace(/( |\u00A0)\(/g,'<span class="typograf-oa-sp-lbracket">$1</span><span class="typograf-oa-lbracket">(</span>').replace(/(^|\n)\(/g,'$1<span class="typograf-oa-n-lbracket">(</span>')},disabled:!0}).innerRule({name:"ru/optalign/bracket",handler:function(e){return e.replace(/<span class="typograf-oa-(sp-lbracket|lbracket|n-lbracket)">(.*?)<\/span>/g,"$2")}}),e.rule({name:"ru/optalign/comma",index:1002,handler:function(e,n){var r=new RegExp("(["+this.letters()+"\\d\u0301]+), ","gi");return e.replace(r,'$1<span class="typograf-oa-comma">,</span><span class="typograf-oa-comma-sp"> </span>')},disabled:!0}).innerRule({name:"ru/optalign/comma",handler:function(e){return e.replace(/<span class="typograf-oa-(comma|comma-sp)">(.*?)<\/span>/g,"$2")}}),e.rule({name:"ru/optalign/quot",index:1e3,handler:function(n){var r='(["'+this.setting("ru/punctuation/quot","lquot")+this.setting("ru/punctuation/quot","lquot2")+"])",a=new RegExp("([\\d"+this.letters()+"\\-\u0301!?.:;,]+)( |\xa0)("+r+")","gi"),t=new RegExp("(^|\n|"+e._privateLabel+")"+r,"g");return n.replace(a,'$1<span class="typograf-oa-sp-lquot">$2</span><span class="typograf-oa-lquot">$3</span>').replace(t,'$1<span class="typograf-oa-n-lquot">$2</span>')},disabled:!0}).innerRule({name:"ru/optalign/quot",handler:function(e){return e.replace(/<span class="typograf-oa-(sp-lquot|lquot|n-lquot)">(.*?)<\/span>/g,"$2")}}),e.rule({name:"ru/other/accent",index:560,handler:function(e){return e.replace(/([\u0430-\u044f\u0451])([\u0410\u0415\u0401\u0418\u041e\u0423\u042b\u042d\u042e\u042f])([^\u0410-\u042f\u0401\w]|$)/g,function(e,n,r,a){return n+r.toLowerCase()+"\u0301"+a})},disabled:!0}),e.rule({name:"ru/punctuation/ano",index:1110,handler:function(e){var n=new RegExp("([^!?,:;\\-\u2012\u2013\u2014])([ \xa0\n])(\u0430|\u043d\u043e)(?= |\xa0|\n)","g");return e.replace(n,"$1,$2$3")}}),e.rule({name:"ru/punctuation/apostrophe",index:695,handler:function(e){var n="(["+this.letters()+"])",r=new RegExp(n+"['\u2019]"+n,"gi");return e.replace(r,"$1\u02bc$2")}}),e.rule({name:"ru/punctuation/hellip",index:20,handler:function(e){return e.replace(/(^|[^.])\.{3,4}([^.]|$)/g,"$1\u2026$2").replace(/(^|[^.])(\.\.\.|\u2026),/g,"$1\u2026").replace(/(\!|\?)(\.\.\.|\u2026)([^.]|$)/g,"$1..$3")}}),e.rule({name:"ru/punctuation/quot",index:700,handler:function(n,r){var a=r.lquot,t=r.rquot;return n=e._quot.call(this,n,r),a===r.lquot2&&t===r.rquot2?n.replace(new RegExp(a+a,"g"),a).replace(new RegExp(t+t,"g"),t):n},settings:{lquot:"\xab",rquot:"\xbb",lquot2:"\u201e",rquot2:"\u201c",lquot3:"\u201a",rquot3:"\u2018"}}),e.rule({name:"ru/space/year",index:600,handler:function(e){var n=new RegExp("(^| |\xa0)(\\d{3,4})(\u0433\u043e\u0434([\u0430\u0443\u0435]|\u043e\u043c)?)([^"+this.letters()+"]|$)","g");return e.replace(n,"$1$2 $3$5")}}),e._sortRules(),e._needSortRules=!0,e}); | ||
!function(e,n){"use strict";"function"==typeof define&&define.amd?define("typograf",[],n):"object"==typeof exports?module.exports=n():e.Typograf=n()}(this,function(){function e(e){this._prefs="object"==typeof e?e:{},this._prefs.live=this._prefs.live||!1,this._settings={},this._enabledRules={},this._replaceLabel=this._replaceLabel.bind(this),this._pasteLabel=this._pasteLabel.bind(this),this._initSafeTags(),this._rules.forEach(this._prepareRule,this),this._prefs.disable&&this.disable(this._prefs.disable),this._prefs.enable&&this.enable(this._prefs.enable)}return e.rule=function(n){var r=n.name.split("/");return n._enabled=n.disabled===!0?!1:!0,n._lang=r[0],n._group=r[1],n._name=r[2],e._setIndex(n),"common"!==n._lang&&-1!==e._langs.indexOf(n._lang)&&e._langs.push(n._lang),e.prototype._rules.push(n),e._needSortRules&&this._sortRules(),this},e._setIndex=function(n){var r=n.index,a=typeof r,t=e.groupIndexes[n._group];"undefined"===a?r=t:"string"===a&&(r=t+parseInt(n.index,10)),n._index=r},e.innerRule=function(n){return e.prototype._innerRules.push(n),n._lang=n.name.split("/")[0],this},e.data=function(n,r){if("string"==typeof n){if(1===arguments.length)return e._data[n];e._data[n]=r}else"object"==typeof n&&Object.keys(n).forEach(function(r){e._data[r]=n[r]})},e._data={},e._sortRules=function(){e.prototype._rules.sort(function(e,n){return e._index>n._index?1:-1})},e._replace=function(e,n){for(var r=0;r<n.length;r++)e=e.replace(n[r][0],n[r][1]);return e},e._langs=[],e._privateLabel="\udbff",e.prototype={constructor:e,execute:function(e,n){n=n||{};var r=this,a=n.lang||this._prefs.lang||"common",t={},u={},l="undefined"==typeof n.mode?this._prefs.mode:n.mode,i=function(n){var r=n._lang,t=this._prefs.live;t===!0&&n.live===!1||t===!1&&n.live===!0||"common"!==r&&r!==a||!this.enabled(n.name)||(this._onBeforeRule&&this._onBeforeRule(e),e=n.handler.call(this,e,this._settings[n.name]),this._onAfterRule&&this._onAfterRule(e))},s=function(e){u[e]&&u[e].forEach(i,r),t[e]&&t[e].forEach(i,r)};return this._lang=a,(e=""+e)?(e=this._fixLineEnd(e),this._innerRules.forEach(function(e){var n=e.queue;u[n]=u[n]||[],u[n].push(e)},this),this._rules.forEach(function(e){var n=e.queue;t[n]=t[n]||[],t[n].push(e)},this),this._isHTML=-1!==e.search(/(<\/?[a-z]|<!|&[lg]t;)/i),s("start"),this._isHTML&&(e=this._hideSafeTags(e)),e=this._utfication(e),s("utf"),s(),e=this._modification(e,l),s("entity"),this._isHTML&&(e=this._showSafeTags(e)),s("end"),this._lang=null,this._isHTML=null,e):""},setting:function(e,n,r){return arguments.length<=2?this._settings[e]&&this._settings[e][n]:(this._settings[e]=this._settings[e]||{},this._settings[e][n]=r,this)},enabled:function(e){return this._enabledRules[e]},disabled:function(e){return!this._enabledRules[e]},enable:function(e){return this._enable(e,!0)},disable:function(e){return this._enable(e,!1)},addSafeTag:function(e,n){this._safeTags.push([e,n])},_data:function(n){return e.data(this._lang+"/"+n)},_quote:function(n,r){var a=this._data("l")+"\u0301\\d",t=e._privateLabel,u=r.lquote,l=r.rquote,i=r.lquote2,s=r.rquote2,o="["+e.data("common/quote")+"]",c="["+a+")!?.:;#*,]*?",p=new RegExp('"([\u2026'+a+"])","gi"),d=new RegExp("("+c+')"('+c+")","gi"),h=new RegExp(o,"g"),g=new RegExp("^(\\s)?("+o+")","g"),m=new RegExp("(^|\\s)"+o+t,"g"),f=new RegExp(t+o+"([\\s!?.:;#*,]|$)","g"),$=0;return n=n.replace(h,function(){return $++,'"'}).replace(p,u+"$1").replace(d,"$1"+l+"$2").replace(m,"$1"+u+t).replace(f,t+l+"$1").replace(g,"$1"+u),i&&s&&$%2===0?this._innerQuote(n,r):n},_innerQuote:function(e,n){var r=[n.lquote],a=[n.rquote],t=n.lquote,u=n.rquote,l=new Array(e.length);n.lquote2&&n.rquote2&&(r.push(n.lquote2),a.push(n.rquote2),n.lquote3&&n.rquote3&&(r.push(n.lquote3),a.push(n.rquote3)));for(var i=-1,s=r.length-1,o=0,c=e.length;c>o;o++){var p=e[o];p===t?(i++,i>s&&(i=s),l.push(r[i])):p===u?-1>=i?(i=0,l.push(r[i])):(l.push(a[i]),i--,-1>i&&(i=-1)):l.push(p)}return l.join("")},_fixLineEnd:function(e){return e.replace(/\r\n/g,"\n")},_prepareRule:function(e){var n=e.name,r={};"object"==typeof e.settings&&Object.keys(e.settings).forEach(function(n){r[n]=e.settings[n]}),this._settings[n]=r,this._enabledRules[n]=e._enabled},_enable:function(e,n){return Array.isArray(e)?e.forEach(function(e){this._enableByMask(e,n)},this):this._enableByMask(e,n),this},_enableByMask:function(e,n){var r;-1!==e.search(/\*/)?(r=new RegExp(e.replace(/\//g,"\\/").replace(/\*/g,".*")),this._rules.forEach(function(e){var a=e.name;r.test(a)&&(this._enabledRules[a]=n)},this)):this._enabledRules[e]=n},_rules:[],_innerRules:[],_getRule:function(e){var n=null;return this._rules.some(function(r){return r.name===e?(n=r,!0):!1}),n},_initSafeTags:function(){this._safeTags=[["<!--","-->"],["<!ENTITY",">"],["<!DOCTYPE",">"],["<\\?xml","\\?>"],["<!\\[CDATA\\[","\\]\\]>"]],["code","kbd","object","pre","samp","script","style","var"].forEach(function(e){this._safeTags.push(["<"+e+"(\\s[^>]*?)?>","</"+e+">"])},this)},_hideSafeTags:function(e){return this._hiddenSafeTags={},this._iLabel=0,this._safeTags.forEach(function(n){var r=new RegExp(n[0]+"[^]*?"+n[1],"gi");e=e.replace(r,this._pasteLabel)},this),this._hideHTMLTags(e)},_getPrivateLabel:function(n){var r=e._privateLabel;return r+"tf"+n+r},_pasteLabel:function(e){var n=this._getPrivateLabel(this._iLabel);return this._hiddenSafeTags[n]=e,this._iLabel++,n},_replaceLabel:function(e){return this._hiddenSafeTags[e]},_hideHTMLTags:function(e){return e.replace(/<\/?[a-z][^]*?>/gi,this._pasteLabel).replace(/<\/?[a-z][^]*?>/gi,this._pasteLabel).replace(/&[gl]t;/gi,this._pasteLabel)},_showSafeTags:function(n){for(var r=e._privateLabel,a=new RegExp(r+"tf\\d+"+r,"g"),t=new RegExp(r+"tf\\d"),u=0;u<this._safeTags.length&&(n=n.replace(a,this._replaceLabel),-1!==n.search(t));u++);return delete this._hiddenSafeTags,n},_utfication:function(e){return-1!==e.search(/&#/)&&(e=this._decHexToUtf(e)),-1!==e.search(/&[a-z]/i)&&this.entities.forEach(function(n){e=e.replace(n[3],n[2])}),e.replace(/"/g,'"')},_decHexToUtf:function(e){return e.replace(/&#(\d{1,6});/gi,function(e,n){return String.fromCharCode(parseInt(n,10))}).replace(/&#x([\da-f]{1,6});/gi,function(e,n){return String.fromCharCode(parseInt(n,16))})},_modification:function(e,n){if("name"===n||"digit"===n){var r="name"===n?0:1;this.entities.forEach(function(n){n[r]&&(e=e.replace(n[4],n[r]))})}return e}},e.groupIndexes={symbols:110,space:210,dash:310,punctuation:410,nbsp:510,number:610,money:710,date:810,other:910,optalign:1010,html:1110},e.prototype.entities=[],[["nbsp",160],["iexcl",161],["cent",162],["pound",163],["curren",164],["yen",165],["brvbar",166],["sect",167],["uml",168],["copy",169],["ordf",170],["laquo",171],["not",172],["shy",173],["reg",174],["macr",175],["deg",176],["plusmn",177],["sup2",178],["sup3",179],["acute",180],["micro",181],["para",182],["middot",183],["cedil",184],["sup1",185],["ordm",186],["raquo",187],["frac14",188],["frac12",189],["frac34",190],["iquest",191],["Agrave",192],["Aacute",193],["Acirc",194],["Atilde",195],["Auml",196],["Aring",197],["AElig",198],["Ccedil",199],["Egrave",200],["Eacute",201],["Ecirc",202],["Euml",203],["Igrave",204],["Iacute",205],["Icirc",206],["Iuml",207],["ETH",208],["Ntilde",209],["Ograve",210],["Oacute",211],["Ocirc",212],["Otilde",213],["Ouml",214],["times",215],["Oslash",216],["Ugrave",217],["Uacute",218],["Ucirc",219],["Uuml",220],["Yacute",221],["THORN",222],["szlig",223],["agrave",224],["aacute",225],["acirc",226],["atilde",227],["auml",228],["aring",229],["aelig",230],["ccedil",231],["egrave",232],["eacute",233],["ecirc",234],["euml",235],["igrave",236],["iacute",237],["icirc",238],["iuml",239],["eth",240],["ntilde",241],["ograve",242],["oacute",243],["ocirc",244],["otilde",245],["ouml",246],["divide",247],["oslash",248],["ugrave",249],["uacute",250],["ucirc",251],["uuml",252],["yacute",253],["thorn",254],["yuml",255],["fnof",402],["Alpha",913],["Beta",914],["Gamma",915],["Delta",916],["Epsilon",917],["Zeta",918],["Eta",919],["Theta",920],["Iota",921],["Kappa",922],["Lambda",923],["Mu",924],["Nu",925],["Xi",926],["Omicron",927],["Pi",928],["Rho",929],["Sigma",931],["Tau",932],["Upsilon",933],["Phi",934],["Chi",935],["Psi",936],["Omega",937],["alpha",945],["beta",946],["gamma",947],["delta",948],["epsilon",949],["zeta",950],["eta",951],["theta",952],["iota",953],["kappa",954],["lambda",955],["mu",956],["nu",957],["xi",958],["omicron",959],["pi",960],["rho",961],["sigmaf",962],["sigma",963],["tau",964],["upsilon",965],["phi",966],["chi",967],["psi",968],["omega",969],["thetasym",977],["upsih",978],["piv",982],["bull",8226],["hellip",8230],["prime",8242],["Prime",8243],["oline",8254],["frasl",8260],["weierp",8472],["image",8465],["real",8476],["trade",8482],["alefsym",8501],["larr",8592],["uarr",8593],["rarr",8594],["darr",8595],["harr",8596],["crarr",8629],["lArr",8656],["uArr",8657],["rArr",8658],["dArr",8659],["hArr",8660],["forall",8704],["part",8706],["exist",8707],["empty",8709],["nabla",8711],["isin",8712],["notin",8713],["ni",8715],["prod",8719],["sum",8721],["minus",8722],["lowast",8727],["radic",8730],["prop",8733],["infin",8734],["ang",8736],["and",8743],["or",8744],["cap",8745],["cup",8746],["int",8747],["there4",8756],["sim",8764],["cong",8773],["asymp",8776],["ne",8800],["equiv",8801],["le",8804],["ge",8805],["sub",8834],["sup",8835],["nsub",8836],["sube",8838],["supe",8839],["oplus",8853],["otimes",8855],["perp",8869],["sdot",8901],["lceil",8968],["rceil",8969],["lfloor",8970],["rfloor",8971],["lang",9001],["rang",9002],["spades",9824],["clubs",9827],["hearts",9829],["diams",9830],["loz",9674],["OElig",338],["oelig",339],["Scaron",352],["scaron",353],["Yuml",376],["circ",710],["tilde",732],["ensp",8194],["emsp",8195],["thinsp",8201],["zwnj",8204],["zwj",8205],["lrm",8206],["rlm",8207],["ndash",8211],["mdash",8212],["lsquo",8216],["rsquo",8217],["sbquo",8218],["ldquo",8220],["rdquo",8221],["bdquo",8222],["dagger",8224],["Dagger",8225],["permil",8240],["lsaquo",8249],["rsaquo",8250],["euro",8364],["NestedGreaterGreater",8811],["NestedLessLess",8810]].forEach(function(n){var r=n[0],a=n[1],t=String.fromCharCode(a),u=["&"+r+";","&#"+a+";",t,new RegExp("&"+r+";","g"),new RegExp(t,"g")];e.prototype.entities.push(u)},this),e.data("common/dash","--?|\u2012|\u2013|\u2014"),e.data("common/quote",'\xab\u2039\xbb\u203a\u201e\u201a\u201c\u201f\u2018\u201b\u201d\u2019"'),e.data({"en/l":"a-z","en/L":"A-Z","en/lL":"a-zA-Z"}),e._langs.push("en"),e.data({"ru/dashBefore":"(^| |\\n)","ru/dashAfter":"([\xa0 ,.?:!]|$)"}),e.data({"ru/l":"\u0430-\u044f\u0451a-z","ru/L":"\u0410-\u042f\u0401A-Z","ru/lL":"\u0430-\u044f\u0451\u0410-\u042f\u0401a-zA-Z"}),e._langs.push("ru"),e.data({"ru/month":"\u044f\u043d\u0432\u0430\u0440\u044c|\u0444\u0435\u0432\u0440\u0430\u043b\u044c|\u043c\u0430\u0440\u0442|\u0430\u043f\u0440\u0435\u043b\u044c|\u043c\u0430\u0439|\u0438\u044e\u043d\u044c|\u0438\u044e\u043b\u044c|\u0430\u0432\u0433\u0443\u0441\u0442|\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c|\u043e\u043a\u0442\u044f\u0431\u0440\u044c|\u043d\u043e\u044f\u0431\u0440\u044c|\u0434\u0435\u043a\u0430\u0431\u0440\u044c","ru/monthGenCase":"\u044f\u043d\u0432\u0430\u0440\u044f|\u0444\u0435\u0432\u0440\u0430\u043b\u044f|\u043c\u0430\u0440\u0442\u0430|\u0430\u043f\u0440\u0435\u043b\u044f|\u043c\u0430\u044f|\u0438\u044e\u043d\u044f|\u0438\u044e\u043b\u044f|\u0430\u0432\u0433\u0443\u0441\u0442\u0430|\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f|\u043e\u043a\u0442\u044f\u0431\u0440\u044f|\u043d\u043e\u044f\u0431\u0440\u044f|\u0434\u0435\u043a\u0430\u0431\u0440\u044f","ru/monthPreCase":"\u044f\u043d\u0432\u0430\u0440\u0435|\u0444\u0435\u0432\u0440\u0430\u043b\u0435|\u043c\u0430\u0440\u0442\u0435|\u0430\u043f\u0440\u0435\u043b\u0435|\u043c\u0430\u0435|\u0438\u044e\u043d\u0435|\u0438\u044e\u043b\u0435|\u0430\u0432\u0433\u0443\u0441\u0442\u0435|\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u0435|\u043e\u043a\u0442\u044f\u0431\u0440\u0435|\u043d\u043e\u044f\u0431\u0440\u0435|\u0434\u0435\u043a\u0430\u0431\u0440\u0435","ru/shortMonth":"\u044f\u043d\u0432|\u0444\u0435\u0432|\u043c\u0430\u0440|\u0430\u043f\u0440|\u043c\u0430[\u0435\u0439\u044f]|\u0438\u044e\u043d|\u0438\u044e\u043b|\u0430\u0432\u0433|\u0441\u0435\u043d|\u043e\u043a\u0442|\u043d\u043e\u044f|\u0434\u0435\u043a"}),e.data("ru/weekday","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a|\u0432\u0442\u043e\u0440\u043d\u0438\u043a|\u0441\u0440\u0435\u0434\u0430|\u0447\u0435\u0442\u0432\u0435\u0440\u0433|\u043f\u044f\u0442\u043d\u0438\u0446\u0430|\u0441\u0443\u0431\u0431\u043e\u0442\u0430|\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435"),e.rule({name:"common/html/e-mail",handler:function(e){return e.replace(/(^|[\s;(])([\w\-.]{2,})@([\w\-.]{2,})\.([a-z]{2,6})([)\s.,!?]|$)/gi,'$1<a href="mailto:$2@$3.$4">$2@$3.$4</a>$5')},disabled:!0}),e.rule({name:"common/html/escape",index:"+100",queue:"end",handler:function(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return e.replace(/[&<>"'\/]/g,function(e){return n[e]})},disabled:!0}),e.rule({name:"common/html/nbr",index:"+5",queue:"end",handler:function(e){return-1===e.search(/<br/)?e.replace(/\n/g,"<br/>\n"):e},disabled:!0}),e.rule({name:"common/html/pbr",queue:"end",handler:function(e){return-1===e.search(/<(p|br)[\s\/>]/)&&(-1===e.search(/\n/)?e="<p>"+e+"</p>":(e="<p>"+e.replace(/\n\n/g,"</p>\n<p>")+"</p>",e=e.replace(/([^>])\n/g,"$1<br/>\n"))),e},disabled:!0}),e.rule({name:"common/html/stripTags",index:"+99",queue:"end",handler:function(e){return e.replace(/<[^>]+>/g,"")},disabled:!0}),e.rule({name:"common/html/url",handler:function(e){var n="(http|https|ftp|telnet|news|gopher|file|wais)://",r="([a-zA-Z0-9/+-=%&:_.~?]+[a-zA-Z0-9#+]*)",a=new RegExp(n+r,"g");return e.replace(a,function(e,n,r){r=r.replace(/([^\/]+\/?)(\?|#)$/,"$1").replace(/^([^\/]+)\/$/,"$1"),"http"===n?r=r.replace(/^([^\/]+)(:80)([^\d]|\/|$)/,"$1$3"):"https"===n&&(r=r.replace(/^([^\/]+)(:443)([^\d]|\/|$)/,"$1$3"));var a=r,t=n+"://"+r,u='<a href="'+t+'">';return"http"===n||"https"===n?(a=a.replace(/^www\./,""),u+("http"===n?a:n+"://"+a)+"</a>"):u+t+"</a>"})},disabled:!0}),e.rule({name:"common/nbsp/afterNumber",handler:function(e){var n="(^|\\D)(\\d{1,5}) (["+this._data("l")+"]{2,})";return e.replace(new RegExp(n,"gi"),"$1$2\xa0$3")},disabled:!0}),e.rule({name:"common/nbsp/afterParagraph",handler:function(e){return e.replace(/\u00A7[ \u00A0\u2009]?(\d|I|V|X)/g,"\xa7\u202f$1")}}),e.rule({name:"common/nbsp/afterShortWord",handler:function(n,r){var a=r.lengthShortWord,t=" \xa0("+e._privateLabel+e.data("common/quote"),u="(^|["+t+"])(["+this._data("l")+"]{1,"+a+"}) ",l="$1$2\xa0",i=new RegExp(u,"gim");return n.replace(i,l).replace(i,l)},settings:{lengthShortWord:2}}),e.rule({name:"common/nbsp/beforeShortLastWord",handler:function(e,n){var r=new RegExp("(["+this._data("l")+"d]) (["+this._data("lL")+"]{1,"+n.lengthLastWord+"}[.!?])( ["+this._data("L")+"]|$)","g");return e.replace(r,"$1\xa0$2$3")},settings:{lengthLastWord:3}}),e.rule({name:"common/nbsp/dpi",handler:function(e){return e.replace(/(\d) ?(lpi|dpi)(?!\w)/,"$1\xa0$2")}}),function(){function n(e,n,r,a){return n+r.replace(/([^\u00A0])\u00A0([^\u00A0])/g,"$1 $2")+a}e.rule({name:"common/nbsp/nowrap",queue:"end",handler:function(e){return e.replace(/(<nowrap>)(.*?)(<\/nowrap>)/g,n).replace(/(<nobr>)(.*?)(<\/nobr>)/g,n)}})}(),e.rule({name:"common/nbsp/replaceNbsp",queue:"utf",live:!0,handler:function(e){return e.replace(/\u00A0/g," ")}}),e.rule({name:"common/number/fraction",handler:function(e){return e.replace(/(^|\D)1\/2(\D|$)/g,"$1\xbd$2").replace(/(^|\D)1\/4(\D|$)/g,"$1\xbc$2").replace(/(^|\D)3\/4(\D|$)/g,"$1\xbe$2")}}),e.rule({name:"common/number/mathSigns",handler:function(n){return e._replace(n,[[/!=/g,"\u2260"],[/<=/g,"\u2264"],[/(^|[^=])>=/g,"$1\u2265"],[/<=>/g,"\u21d4"],[/<</g,"\u226a"],[/>>/g,"\u226b"],[/~=/g,"\u2245"],[/\+-/g,"\xb1"]])}}),e.rule({name:"common/number/times",handler:function(e){return e.replace(/(\d)[ \u00A0]?(x|\u0445)[ \u00A0]?(\d)/g,"$1\xd7$3")}}),e.rule({name:"common/other/delBOM",queue:"start",index:-1,handler:function(e){return 65279===e.charCodeAt(0)?e.slice(1):e}}),e.rule({name:"common/other/repeatWord",handler:function(e){var n=new RegExp("(["+this._data("l")+"\u0301]+) \\1([;:,.?! \n])","gi");return e.replace(n,"$1$2")},disabled:!0}),e.rule({name:"common/punctuation/delDoublePunctuation",handler:function(e){return e.replace(/(^|[^,]),,(?!,)/g,"$1,").replace(/(^|[^:])::(?!:)/g,"$1:").replace(/(^|[^!?\.])\.\.(?!\.)/g,"$1.").replace(/(^|[^;]);;(?!;)/g,"$1;").replace(/(^|[^?])\?\?(?!\?)/g,"$1?")}}),e.rule({name:"common/space/afterPunctuation",handler:function(n){var r=e._privateLabel,a=new RegExp("(!|;|\\?)([^.!;?\\s[\\])"+r+e.data("common/quote")+"])","g"),t=new RegExp("(\\D)(,|:)([^,:.?\\s\\/"+r+"])","g");return n.replace(a,"$1 $2").replace(t,"$1$2 $3")}}),e.rule({name:"common/space/beforeBracket",handler:function(e){var n=new RegExp("(["+this._data("l")+".!?,;\u2026)])\\(","gi");return e.replace(n,"$1 (")}}),e.rule({name:"common/space/bracket",handler:function(e){return e.replace(/(\() +/g,"(").replace(/ +\)/g,")")}}),e.rule({name:"common/space/delBeforePercent",handler:function(e){return e.replace(/(\d)( |\u00A0)(%|\u2030|\u2031)/g,"$1$3")}}),e.rule({name:"common/space/delBeforePunctuation",handler:function(e){return e.replace(/ ([!;,?.:])/g,"$1")}}),e.rule({name:"common/space/delLeadingBlanks",handler:function(e){return e.replace(/\n[ \t]+/g,"\n")},disabled:!0}),e.rule({name:"common/space/delRepeatN",index:"-1",handler:function(e){return e.replace(/\n{3,}/g,"\n\n")}}),e.rule({name:"common/space/delRepeatSpace",index:"-1",handler:function(e){return e.replace(/([^\n \t])( |\t){2,}([^\n \t])/g,"$1$2$3")}}),e.rule({name:"common/space/delTrailingBlanks",index:"-3",handler:function(e){return e.replace(/[ \t]+\n/g,"\n")}}),e.rule({name:"common/space/replaceTab",index:"-5",handler:function(e){return e.replace(/\t/g," ")}}),e.rule({name:"common/space/squareBracket",handler:function(e){return e.replace(/(\[) +/g,"[").replace(/ +\]/g,"]")}}),e.rule({name:"common/space/trimLeft",index:"-4",handler:String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^[\s\uFEFF\xA0]+/g,"")}}),e.rule({name:"common/space/trimRight",index:"-3",live:!1,handler:String.prototype.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/[\s\uFEFF\xA0]+$/g,"")}}),e.rule({name:"common/symbols/arrow",handler:function(n){return e._replace(n,[[/(^|[^-])->(?!>)/g,"$1\u2192"],[/(^|[^<])<-(?!-)/g,"$1\u2190"]])}}),e.rule({name:"common/symbols/cf",handler:function(e){var n=new RegExp('(\\d+)( |\xa0)?(C|F)([\\W \\.,:!\\?"\\]\\)]|$)',"g");return e.replace(n,"$1\u2009\xb0$3$4")}}),e.rule({name:"common/symbols/copy",handler:function(n){return e._replace(n,[[/\(r\)/gi,"\xae"],[/(copyright )?\((c|\u0441)\)/gi,"\xa9"],[/\(tm\)/gi,"\u2122"]])}}),e.rule({name:"en/punctuation/quote",handler:function(e,n){return this._quote(e,n)},settings:{lquote:"\u201c",rquote:"\u201d",lquote2:"\u2018",rquote2:"\u2019"}}),e.rule({name:"ru/dash/centuries",handler:function(n){var r="("+e.data("common/dash")+")",a=new RegExp("(X|I|V)[ |\xa0]?"+r+"[ |\xa0]?(X|I|V)","g");return n.replace(a,"$1"+this.setting("ru/dash/centuries","dash")+"$3")},settings:{dash:"\u2014"}}),e.rule({name:"ru/dash/daysMonth",handler:function(n){var r=new RegExp("(^|\\s)([123]?\\d)("+e.data("common/dash")+")([123]?\\d)[ \xa0]("+e.data("ru/monthGenCase")+")","g");return n.replace(r,"$1$2\u2014$4\xa0$5")}}),e.rule({name:"ru/dash/decade",handler:function(n){var r=new RegExp("(^|\\s)(\\d{3}|\\d)0("+e.data("common/dash")+")(\\d{3}|\\d)0(-\u0435[ \xa0])(?=\u0433\\.?[ \xa0]?\u0433|\u0433\u043e\u0434)","g");return n.replace(r,"$1$20\u2014$40$5")}}),e.rule({name:"ru/dash/directSpeech",handler:function(n){var r=e.data("common/dash"),a=new RegExp('(["\xbb\u2018\u201c,.\u2026?!])[ |\xa0]?('+r+")[ |\xa0]","g"),t=new RegExp("(^|"+e._privateLabel+")("+r+")( |\xa0)","gm");return n.replace(a,"$1 \u2014\xa0").replace(t,"$1\u2014\xa0")}}),e.rule({name:"ru/dash/izpod",handler:function(n){var r=new RegExp(e.data("ru/dashBefore")+"(\u0418|\u0438)\u0437 \u043f\u043e\u0434"+e.data("ru/dashAfter"),"g");return n.replace(r,"$1$2\u0437-\u043f\u043e\u0434$3")}}),e.rule({name:"ru/dash/izza",handler:function(n){var r=new RegExp(e.data("ru/dashBefore")+"(\u0418|\u0438)\u0437 \u0437\u0430"+e.data("ru/dashAfter"),"g");return n.replace(r,"$1$2\u0437-\u0437\u0430$3")}}),e.rule({name:"ru/dash/kade",handler:function(n){var r=new RegExp("([a-\u044f\u0451]+)( | ?- ?)(\u043a\u0430|\u0434\u0435|\u043a\u0430\u0441\u044c)"+e.data("ru/dashAfter"),"g");return n.replace(r,"$1-$3$4")}}),e.rule({name:"ru/dash/koe",handler:function(n){var r=new RegExp(e.data("ru/dashBefore")+"([\u041a\u043a]\u043e[\u0435\u0439])\\s([\u0430-\u044f\u0451]{3,})"+e.data("ru/dashAfter"),"g");return n.replace(r,"$1$2-$3$4")}}),e.rule({name:"ru/dash/main",index:"-5",handler:function(n){var r=e.data("common/dash"),a=new RegExp("( |\xa0)("+r+")( |\\n)","g");return n.replace(a,"\xa0\u2014$3")}}),e.rule({name:"ru/dash/month",handler:function(n){var r="("+e.data("ru/month")+")",a="("+e.data("ru/monthPreCase")+")",t=e.data("common/dash"),u=new RegExp(r+" ?("+t+") ?"+r,"gi"),l=new RegExp(a+" ?("+t+") ?"+a,"gi");return n.replace(u,"$1\u2014$3").replace(l,"$1\u2014$3")}}),e.rule({name:"ru/dash/surname",handler:function(e){var n=new RegExp("([\u0410-\u042f\u0401][\u0430-\u044f\u0451]+)\\s-([\u0430-\u044f\u0451]{1,3})(?![^\u0430-\u044f\u0451]|$)","g");return e.replace(n,"$1\xa0\u2014$2")}}),e.rule({name:"ru/dash/taki",handler:function(n){var r=new RegExp("(\u0432\u0435\u0440\u043d\u043e|\u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e|\u043e\u043f\u044f\u0442\u044c|\u043f\u0440\u044f\u043c\u043e|\u0442\u0430\u043a|\u0432\u0441[\u0435\u0451]|\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e|\u043d\u0435\u0443\u0436\u0435\u043b\u0438)\\s(\u0442\u0430\u043a\u0438)"+e.data("ru/dashAfter"),"g");return n.replace(r,"$1-$2$3")}}),e.rule({name:"ru/dash/time",handler:function(n){var r=new RegExp(e.data("ru/dashBefore")+"(\\d?\\d:[0-5]\\d)"+e.data("common/dash")+"(\\d?\\d:[0-5]\\d)"+e.data("ru/dashAfter"),"g");return n.replace(r,"$1$2\u2014$3$4")}}),e.rule({name:"ru/dash/to",handler:function(n){var r=["\u043e\u0442\u043a\u0443\u0434\u0430","\u043a\u0443\u0434\u0430","\u0433\u0434\u0435","\u043a\u043e\u0433\u0434\u0430","\u0437\u0430\u0447\u0435\u043c","\u043f\u043e\u0447\u0435\u043c\u0443","\u043a\u0430\u043a","\u043a\u0430\u043a\u043e[\u0435\u0439\u043c]","\u043a\u0430\u043a\u0430\u044f","\u043a\u0430\u043a\u0438[\u0435\u043c\u0445]","\u043a\u0430\u043a\u0438\u043c\u0438","\u043a\u0430\u043a\u0443\u044e","\u0447\u0442\u043e","\u0447\u0435\u0433\u043e","\u0447\u0435[\u0439\u043c]","\u0447\u044c\u0438\u043c?","\u043a\u0442\u043e","\u043a\u043e\u0433\u043e","\u043a\u043e\u043c\u0443","\u043a\u0435\u043c"],a=new RegExp("("+r.join("|")+")( | ?- ?)(\u0442\u043e|\u043b\u0438\u0431\u043e|\u043d\u0438\u0431\u0443\u0434\u044c)"+e.data("ru/dashAfter"),"gi");return n.replace(a,"$1-$3$4")}}),e.rule({name:"ru/dash/weekday",handler:function(n){var r="("+e.data("ru/weekday")+")",a=new RegExp(r+" ?("+e.data("common/dash")+") ?"+r,"gi");return n.replace(a,"$1\u2014$3")}}),e.rule({name:"ru/dash/years",handler:function(n){var r=this.setting("ru/dash/years","dash"),a=e.data("common/dash"),t=new RegExp("(\\D|^)(\\d{4})[ \xa0]?("+a+")[ \xa0]?(\\d{4})(?=[ \xa0]?\u0433)","g");return n.replace(t,function(e,n,a,t,u){return parseInt(a,10)<parseInt(u,10)?n+a+r+u:e})},settings:{dash:"\u2014"}}),e.rule({name:"ru/date/fromISO",handler:function(e){var n="(-|\\.|\\/)",r="(-|\\/)",a=new RegExp("(^|\\D)(\\d{4})"+n+"(\\d{2})"+n+"(\\d{2})(\\D|$)","gi"),t=new RegExp("(^|\\D)(\\d{2})"+r+"(\\d{2})"+r+"(\\d{4})(\\D|$)","gi");return e.replace(a,"$1$6.$4.$2$7").replace(t,"$1$4.$2.$6$7")}}),e.rule({name:"ru/date/weekday",handler:function(n){var r="( |\xa0)",a=e.data("ru/monthGenCase"),t=e.data("ru/weekday"),u=new RegExp("(\\d)"+r+"("+a+"),"+r+"("+t+")","gi");return n.replace(u,function(){var e=arguments;return e[1]+e[2]+e[3].toLowerCase()+","+e[4]+e[5].toLowerCase()})}}),e.rule({name:"ru/money/dollar",handler:function(e){var n=new RegExp("(^|[\\D]{2,})\\$ ?([\\d.,]+)","g"),r=new RegExp("(^|[\\D])([\\d.,]+) ?\\$","g"),a="$1$2\xa0$";return e.replace(n,a).replace(r,a)}}),e.rule({name:"ru/money/euro",handler:function(e){var n=new RegExp("(^|[\\D]{2,})\u20ac ?([\\d.,]+([ \xa0\u2009\u202f]\\d{3})*)","g"),r=new RegExp("(^|[\\D])([\\d.,]+) ?\u20ac","g"),a="$1$2\xa0\u20ac";return e.replace(n,a).replace(r,a)}}),e.rule({name:"ru/money/ruble",handler:function(e){var n="$1\xa0\u20bd";return e.replace(/^(\d+)( |\u00A0)?(\u0440|\u0440\u0443\u0431)\.$/,n).replace(/(\d+)( |\u00A0)?(\u0440|\u0440\u0443\u0431)\.(?=[!?,:;])/g,n).replace(/(\d+)( |\u00A0)?(\u0440|\u0440\u0443\u0431)\.(?=\s+[A-\u042f\u0401])/g,n+".")},disabled:!0}),e.rule({name:"ru/nbsp/abbr",handler:function(n){var r=new RegExp("(^|\\s|"+e._privateLabel+")(([\u0430-\u044f\u0451]{1,3}\\.){2,})(?![\u0430-\u044f\u0451])","g");return n.replace(r,function(e,n,r){var a=r.split(/\./);return["\u0440\u0444","\u0440\u0443","\u0440\u0443\u0441","\u043e\u0440\u0433","\u0443\u043a\u0440","\u0431\u0433","\u0441\u0440\u0431"].indexOf(a[a.length-2])>-1?e:n+r.split(/\./).join(".\xa0").trim()})}}),e.rule({name:"ru/nbsp/addr",handler:function(e){return e.replace(/(\s|^)(\u0434\u043e\u043c|\u0434\.|\u043a\u0432\.|\u043f\u043e\u0434\.|\u043f\-\u0434) *(\d+)/gi,"$1$2\xa0$3").replace(/(\s|^)(\u043c\u043a\u0440-\u043d|\u043c\u043a-\u043d|\u043c\u043a\u0440\.|\u043c\u043a\u0440\u043d)\s/gi,"$1$2\xa0").replace(/(\s|^)(\u044d\u0442\.) *(-?\d+)/gi,"$1$2\xa0$3").replace(/(\s|^)(\d+) +\u044d\u0442\u0430\u0436([^\u0430-\u044f\u0451]|$)/gi,"$1$2\xa0\u044d\u0442\u0430\u0436$3").replace(/(\s|^)\u043b\u0438\u0442\u0435\u0440\s([\u0410-\u042f]|$)/gi,"$1\u043b\u0438\u0442\u0435\u0440\xa0$2").replace(/(\s|^)(\u043e\u0431\u043b|\u043a\u0440|\u0441\u0442|\u043f\u043e\u0441|\u0441|\u0434|\u0443\u043b|\u043f\u0435\u0440|\u043f\u0440|\u043f\u0440\-\u0442|\u043f\u0440\u043e\u0441\u043f|\u043f\u043b|\u0431\u0443\u043b|\u0431\-\u0440|\u043d\u0430\u0431|\u0448|\u0442\u0443\u043f|\u043e\u0444|\u043a\u043e\u043c\u043d?|\u0443\u0447|\u0432\u043b|\u0432\u043b\u0430\u0434|\u0441\u0442\u0440|\u043a\u043e\u0440)\. *([\u0430-\u044f\u0451a-z\d]+)/gi,"$1$2.\xa0$3").replace(/(\D[ \u00A0]|^)\u0433\. ?([\u0410-\u042f\u0401])/gm,"$1\u0433.\xa0$2")}}),e.rule({name:"ru/nbsp/afterNumberSign",handler:function(e){return e.replace(/\u2116[ \u00A0\u2009]?(\d|\u043f\/\u043f)/g,"\u2116\u202f$1")}}),e.rule({name:"ru/nbsp/beforeParticle",index:"+5",handler:function(e){var n="(\u043b\u0438|\u043b\u044c|\u0436\u0435|\u0436|\u0431\u044b|\u0431)",r=new RegExp(" "+n+'(?=[?!,.:;"\u2018\u201c\xbb])',"g"),a=new RegExp("[ \xa0]"+n+"[ \xa0]","g");return e.replace(r,"\xa0$1").replace(a,"\xa0$1 ")}}),e.rule({name:"ru/nbsp/centuries",handler:function(n){var r=e.data("common/dash"),a=new RegExp("(^|\\s)([VIX]+)[ \xa0]?\u0432\\.?(?=[^.]|$)","g"),t=new RegExp("(^|\\s)([VIX]+)("+r+")([VIX]+)[ \xa0]?\u0432\\.?([ \xa0]?\u0432\\.?)?(?=[^.]|$)","g");return n.replace(a,"$1$2\xa0\u0432.").replace(t,"$1$2$3$4\xa0\u0432\u0432.")}}),e.rule({name:"ru/nbsp/dayMonth",handler:function(n){var r=new RegExp("(\\d{1,2}) ("+e.data("ru/shortMonth")+")","gi");return n.replace(r,"$1\xa0$2")}}),e.rule({name:"ru/nbsp/m",index:"+5",handler:function(n){var r=e._privateLabel,a=new RegExp("(^|[\\s,."+r+"])(\\d+)[ \xa0]?(\u043c\u043c?|\u0441\u043c|\u043a\u043c|\u0434\u043c|\u0433\u043c|mm?|km|cm|dm)([23\xb2\xb3])?([\\s.!?,;"+r+"]|$)","gm");return n.replace(a,function(e,n,r,a,t,u){var l={2:"\xb2","\xb2":"\xb2",3:"\xb3","\xb3":"\xb3","":""}[t||""];return n+r+"\xa0"+a+l+("\xa0"===u?" ":u)})}}),e.rule({name:"ru/nbsp/ooo",handler:function(e){return e.replace(/(^|[^a-\u044f\u0451A-\u042f\u0401])(\u041e\u041e\u041e|\u041e\u0410\u041e|\u0417\u0410\u041e|\u041d\u0418\u0418|\u041f\u0411\u041e\u042e\u041b) /g,"$1$2\xa0")}}),e.rule({name:"ru/nbsp/page",handler:function(n){var r=new RegExp("(^|[)\\s"+e._privateLabel+"])(\u0441\u0442\u0440|\u0433\u043b|\u0440\u0438\u0441|\u0438\u043b\u043b?|\u0441\u0442|\u043f|c)\\. *(\\d+)([\\s.,?!;:]|$)","gim");return n.replace(r,"$1$2.\xa0$3$4")}}),e.rule({name:"ru/nbsp/ps",handler:function(n){var r=new RegExp("(^|\\s|"+e._privateLabel+")[p\u0437]\\.[ \xa0]?([p\u0437]\\.[ \xa0]?)?[s\u044b]\\.:? ","gim");return n.replace(r,function(e,n,r){return n+(r?"P.\xa0P.\xa0S. ":"P.\xa0S. ")})}}),e.rule({name:"ru/nbsp/see",handler:function(n){var r=new RegExp("(^|\\s|"+e._privateLabel+"|\\()(\u0441\u043c|\u0438\u043c)\\.[ \xa0]?([\u0430-\u044f\u04510-9a-z]+)([\\s.,?!]|$)","gi");return n.replace(r,function(e,n,r,a,t){return("\xa0"===n?" ":n)+r+".\xa0"+a+t})}}),e.rule({name:"ru/nbsp/year",handler:function(e){return e.replace(/(^|\D)(\d{4}) ?\u0433([ ,;.\n]|$)/g,"$1$2\xa0\u0433$3")}}),e.rule({name:"ru/nbsp/years",index:"+5",handler:function(n){var r=e.data("common/dash"),a=new RegExp("(^|\\D)(\\d{4})("+r+")(\\d{4})[ \xa0]?\u0433\\.?([ \xa0]?\u0433\\.)?","g");return n.replace(a,"$1$2$3$4\xa0\u0433\u0433.")}}),e.rule({name:"ru/number/ordinals",handler:function(e){var n=new RegExp("(\\d)-(\u044b\u0439|\u043e\u0439|\u0430\u044f|\u043e\u0435|\u044b\u0435|\u044b\u043c|\u043e\u043c|\u044b\u0445|\u043e\u0433\u043e|\u043e\u043c\u0443|\u044b\u043c\u0438)(?!["+this._data("l")+"])","g");return e.replace(n,function(e,n,r){var a={"\u043e\u0439":"\u0439","\u044b\u0439":"\u0439","\u0430\u044f":"\u044f","\u043e\u0435":"\u0435","\u044b\u0435":"\u0435","\u044b\u043c":"\u043c","\u043e\u043c":"\u043c","\u044b\u0445":"\u0445","\u043e\u0433\u043e":"\u0433\u043e","\u043e\u043c\u0443":"\u043c\u0443","\u044b\u043c\u0438":"\u043c\u0438"};return n+"-"+a[r]})}}),e.rule({name:"ru/optalign/bracket",handler:function(e,n){return e.replace(/( |\u00A0)\(/g,'<span class="typograf-oa-sp-lbracket">$1</span><span class="typograf-oa-lbracket">(</span>').replace(/^\(/gm,'<span class="typograf-oa-n-lbracket">(</span>')},disabled:!0}).innerRule({name:"ru/optalign/bracket",handler:function(e){return e.replace(/<span class="typograf-oa-(n-|sp-)?lbracket">(.*?)<\/span>/g,"$2")}}),e.rule({name:"ru/optalign/comma",handler:function(e,n){var r=new RegExp("(["+this._data("l")+"\\d\u0301]+), ","gi");return e.replace(r,'$1<span class="typograf-oa-comma">,</span><span class="typograf-oa-comma-sp"> </span>')},disabled:!0}).innerRule({name:"ru/optalign/comma",handler:function(e){return e.replace(/<span class="typograf-oa-comma(-sp)?">(.*?)<\/span>/g,"$2")}}),e.rule({name:"ru/optalign/quote",handler:function(n){var r="ru/punctuation/quote",a='(["'+this.setting(r,"lquote")+this.setting(r,"lquote2")+this.setting(r,"lquote3")+"])",t=new RegExp("([\\d"+this._data("l")+"\\-\u0301!?.:;,]+)( |\xa0)("+a+")","gi"),u=new RegExp("(^|"+e._privateLabel+")"+a,"gm");return n.replace(t,'$1<span class="typograf-oa-sp-lquote">$2</span><span class="typograf-oa-lquote">$3</span>').replace(u,'$1<span class="typograf-oa-n-lquote">$2</span>')},disabled:!0}).innerRule({name:"ru/optalign/quote",handler:function(e){return e.replace(/<span class="typograf-oa-(n-|sp-)?lquote">(.*?)<\/span>/g,"$2")}}),e.rule({name:"ru/other/accent",handler:function(e){return e.replace(/([\u0430-\u044f\u0451])([\u0410\u0415\u0401\u0418\u041e\u0423\u042b\u042d\u042e\u042f])([^\u0410-\u042f\u0401\w]|$)/g,function(e,n,r,a){return n+r.toLowerCase()+"\u0301"+a})},disabled:!0}),e.rule({name:"ru/punctuation/ano",handler:function(e){var n=new RegExp("([^!?,:;\\-\u2012\u2013\u2014])([ \xa0\n])(\u0430|\u043d\u043e)(?= |\xa0|\n)","g");return e.replace(n,"$1,$2$3")}}),e.rule({name:"ru/punctuation/apostrophe",index:"-5",handler:function(e){var n="(["+this._data("l")+"])",r=new RegExp(n+"['\u2019]"+n,"gi");return e.replace(r,"$1\u02bc$2")}}),e.rule({name:"ru/punctuation/exclamation",live:!1,handler:function(e){return e.replace(/(^|[^!])!{2}($|[^!])/,"$1!$2").replace(/(^|[^!])!{4}($|[^!])/,"$1!!!$2")}}),e.rule({name:"ru/punctuation/exclamationQuestion", | ||
index:"+5",handler:function(e){var n=new RegExp("(^|[^!])!\\?([^?]|$)","g");return e.replace(n,"$1?!$2")}}),e.rule({name:"ru/punctuation/hellip",handler:function(e){return e.replace(/(^|[^.])\.{3,4}([^.]|$)/g,"$1\u2026$2").replace(/(^|[^.])(\.\.\.|\u2026),/g,"$1\u2026").replace(/(\!|\?)(\.\.\.|\u2026)([^.]|$)/g,"$1..$3")}}),e.rule({name:"ru/punctuation/quote",handler:function(e,n){var r=n.lquote,a=n.rquote;return e=this._quote(e,n),r===n.lquote2&&a===n.rquote2?e.replace(new RegExp(r+r,"g"),r).replace(new RegExp(a+a,"g"),a):e},settings:{lquote:"\xab",rquote:"\xbb",lquote2:"\u201e",rquote2:"\u201c",lquote3:"\u201a",rquote3:"\u2018"}}),e.rule({name:"ru/space/afterHellip",handler:function(e){return e.replace(/([\u0430-\u044f\u0451])(\.\.\.|\u2026)([\u0410-\u042f\u0401])/g,"$1$2 $3").replace(/([?!]\.\.)([\u0430-\u044f\u0451a-z])/gi,"$1 $2")}}),e.rule({name:"ru/space/year",handler:function(e){var n=new RegExp("(^| |\xa0)(\\d{3,4})(\u0433\u043e\u0434([\u0430\u0443\u0435]|\u043e\u043c)?)([^"+this._data("l")+"]|$)","g");return e.replace(n,"$1$2 $3$5")}}),e._sortRules(),e._needSortRules=!0,e}); |
Typograf.titles = { | ||
"common/html/e-mail": { | ||
"en": "Placement of links for e-mail", | ||
"ru": "Расстановка ссылок для эл. почты" | ||
}, | ||
"common/html/escape": { | ||
@@ -6,6 +10,2 @@ "en": "Escaping HTML", | ||
}, | ||
"common/html/mail": { | ||
"en": "Placement of links for e-mail", | ||
"ru": "Расстановка ссылок для эл. почты" | ||
}, | ||
"common/html/nbr": { | ||
@@ -31,3 +31,3 @@ "en": "Replacement line break on <br/>", | ||
}, | ||
"common/nbsp/afterPara": { | ||
"common/nbsp/afterParagraph": { | ||
"en": "Non-breaking space after §", | ||
@@ -45,4 +45,4 @@ "ru": "Нераз. пробел после §" | ||
"common/nbsp/dpi": { | ||
"en": "Non-breaking space before lpi, dpi", | ||
"ru": "Нераз. пробел перед lpi, dpi" | ||
"en": "Non-breaking space before lpi and dpi", | ||
"ru": "Нераз. пробел перед lpi и dpi" | ||
}, | ||
@@ -78,8 +78,2 @@ "common/nbsp/nowrap": { | ||
}, | ||
"common/punctuation/exclamation": { | ||
"common": "!! → !" | ||
}, | ||
"common/punctuation/exclamationQuestion": { | ||
"common": "!? → ?!" | ||
}, | ||
"common/space/afterPunctuation": { | ||
@@ -94,4 +88,4 @@ "en": "space after punctuation", | ||
"common/space/bracket": { | ||
"en": "Remove spaces inside brackets", | ||
"ru": "Удаление лишних пробелов внутри скобок" | ||
"en": "Remove extra spaces after opening and before closing bracket", | ||
"ru": "Удаление лишних пробелов после открывающей и перед закрывающей скобки" | ||
}, | ||
@@ -111,4 +105,4 @@ "common/space/delBeforePercent": { | ||
"common/space/delRepeatN": { | ||
"en": "Remove duplicate line breaks (no more than two)", | ||
"ru": "Удаление повторяющихся переносов строки (не более двух)" | ||
"en": "Remove duplicate line breaks (three or more)", | ||
"ru": "Удаление повторяющихся переносов строки (от трёх и более)" | ||
}, | ||
@@ -128,4 +122,4 @@ "common/space/delRepeatSpace": { | ||
"common/space/squareBracket": { | ||
"en": "Remove spaces inside square brackets", | ||
"ru": "Удаление лишних пробелов внутри квадратных скобок" | ||
"en": "Remove extra spaces after opening and before closing square bracket", | ||
"ru": "Удаление лишних пробелов после открывающей и перед закрывающей квадратной скобки" | ||
}, | ||
@@ -140,35 +134,51 @@ "common/space/trimLeft": { | ||
}, | ||
"common/sym/arrow": { | ||
"common/symbols/arrow": { | ||
"common": "-> → →, <- → ←" | ||
}, | ||
"common/sym/cf": { | ||
"common/symbols/cf": { | ||
"en": "Adding ° to C and F", | ||
"ru": "Добавление ° к C и F" | ||
}, | ||
"common/sym/copy": { | ||
"common/symbols/copy": { | ||
"common": "(c) → ©, (tm) → ™, (r) → ®" | ||
}, | ||
"en/punctuation/quot": { | ||
"en/punctuation/quote": { | ||
"en": "Placement of quotation marks", | ||
"ru": "Расстановка кавычек" | ||
}, | ||
"ru/dash/centuries": { | ||
"en": "Hyphen to dash in centuries", | ||
"ru": "Замена дефиса на тире в веках" | ||
}, | ||
"ru/dash/daysMonth": { | ||
"en": "Dash between days of one month", | ||
"ru": "Тире между днями одного месяца" | ||
}, | ||
"ru/dash/decade": { | ||
"en": "Dash in decade", | ||
"ru": "Тире в десятилетиях, 80—90-е гг." | ||
}, | ||
"ru/dash/directSpeech": { | ||
"en": "Dash in direct speech", | ||
"ru": "Тире в прямой речи" | ||
}, | ||
"ru/dash/izpod": { | ||
"en": "Hyphen between “из-под”", | ||
"ru": "Дефис между из-под" | ||
"ru": "Дефис между «из-под»" | ||
}, | ||
"ru/dash/izza": { | ||
"en": "Hyphen between “из-за”", | ||
"ru": "Дефис между из-за" | ||
"ru": "Дефис между «из-за»" | ||
}, | ||
"ru/dash/kade": { | ||
"en": "Hyphen before “ка, де, кась”", | ||
"ru": "Дефис перед ка, де, кась" | ||
"ru": "Дефис перед «ка», «де», «кась»" | ||
}, | ||
"ru/dash/koe": { | ||
"en": "Hyphen after “кое” and “кой”", | ||
"ru": "Дефис после кое и кой" | ||
"ru": "Дефис после «кое» и «кой»" | ||
}, | ||
"ru/dash/main": { | ||
"en": "Replacement hyphen with dash", | ||
"ru": "Дефис на тире" | ||
"ru": "Замена дефиса на тире" | ||
}, | ||
@@ -179,9 +189,17 @@ "ru/dash/month": { | ||
}, | ||
"ru/dash/surname": { | ||
"en": "Acronyms with a dash", | ||
"ru": "Сокращения с помощью тире" | ||
}, | ||
"ru/dash/taki": { | ||
"en": "Hyphen between “верно-таки” and etc.", | ||
"ru": "Дефис между верно-таки и т.д." | ||
"ru": "Дефис между «верно-таки» и т. д." | ||
}, | ||
"ru/dash/time": { | ||
"en": "Dash in time intervals", | ||
"ru": "Тире в интервалах времени" | ||
}, | ||
"ru/dash/to": { | ||
"en": "Hyphen before “то, либо, нибудь”", | ||
"ru": "Дефис перед то, либо, нибудь" | ||
"en": "Hyphen before “то”, “либо”, “нибудь”", | ||
"ru": "Дефис перед «то», «либо», «нибудь»" | ||
}, | ||
@@ -192,3 +210,7 @@ "ru/dash/weekday": { | ||
}, | ||
"ru/date/main": { | ||
"ru/dash/years": { | ||
"en": "Hyphen to dash in years", | ||
"ru": "Замена дефиса на тире в годах" | ||
}, | ||
"ru/date/fromISO": { | ||
"en": "Converting dates YYYY-MM-DD type DD.MM.YYYY", | ||
@@ -211,3 +233,3 @@ "ru": "Преобразование дат YYYY-MM-DD к виду DD.MM.YYYY" | ||
"en": "Non-breaking space in abbreviations, e.g. “т. д.”", | ||
"ru": "Нераз. пробел в сокращениях, например, в т. д." | ||
"ru": "Нераз. пробел в сокращениях, например, в “т. д.”" | ||
}, | ||
@@ -223,8 +245,8 @@ "ru/nbsp/addr": { | ||
"ru/nbsp/beforeParticle": { | ||
"en": "Non-breaking space before “ли, ль, же, бы, б”", | ||
"ru": "Нераз. пробел перед ли, ль, же, бы, б" | ||
"en": "Non-breaking space before “ли”, “ль”, “же”, “бы”, “б”", | ||
"ru": "Нераз. пробел перед «ли», «ль», «же», «бы», «б»" | ||
}, | ||
"ru/nbsp/cc": { | ||
"en": "Remove spaces and extra points in centuries", | ||
"ru": "Удаление пробелов и лишних точек в вв." | ||
"ru/nbsp/centuries": { | ||
"en": "Remove spaces and extra points in “вв.”", | ||
"ru": "Удаление пробелов и лишних точек в «вв.»" | ||
}, | ||
@@ -244,4 +266,4 @@ "ru/nbsp/dayMonth": { | ||
"ru/nbsp/page": { | ||
"en": "Non-breaking space before “стр., гл., рис., илл.”", | ||
"ru": "Нераз. пробел перед стр., гл., рис., илл." | ||
"en": "Non-breaking space after “стр.”, “гл.”, “рис.”, “илл.”", | ||
"ru": "Нераз. пробел после «стр.», «гл.», «рис.», «илл.»" | ||
}, | ||
@@ -252,7 +274,11 @@ "ru/nbsp/ps": { | ||
}, | ||
"ru/nbsp/xxxx": { | ||
"ru/nbsp/see": { | ||
"en": "Non-breaking space after abbreviation «см.» and «им.»", | ||
"ru": "Нераз. пробел после сокращений «см.» и «им.»" | ||
}, | ||
"ru/nbsp/year": { | ||
"en": "Non-breaking space before XXXX г. (2012 г.)", | ||
"ru": "Нераз. пробел после XXXX г. (2012 г.)" | ||
}, | ||
"ru/nbsp/yy": { | ||
"ru/nbsp/years": { | ||
"en": "г.г. → гг. and non-breaking space", | ||
@@ -272,3 +298,3 @@ "ru": "г.г. → гг. и нераз. пробел" | ||
}, | ||
"ru/optalign/quot": { | ||
"ru/optalign/quote": { | ||
"en": "for opening quotation marks", | ||
@@ -278,8 +304,8 @@ "ru": "для открывающей кавычки" | ||
"ru/other/accent": { | ||
"en": "Replacing capital letter and adding accents", | ||
"ru": "Замена заглавной буквы и добавление знака ударения" | ||
"en": "Replacement capital letters to lowercase with addition of accent", | ||
"ru": "Замена заглавной буквы на строчную с добавлением ударения" | ||
}, | ||
"ru/punctuation/ano": { | ||
"en": "Placement of commas before “а” and “но”", | ||
"ru": "Расстановка запятых перед а и но" | ||
"ru": "Расстановка запятых перед «а» и «но»" | ||
}, | ||
@@ -290,2 +316,8 @@ "ru/punctuation/apostrophe": { | ||
}, | ||
"ru/punctuation/exclamation": { | ||
"common": "!! → !" | ||
}, | ||
"ru/punctuation/exclamationQuestion": { | ||
"common": "!? → ?!" | ||
}, | ||
"ru/punctuation/hellip": { | ||
@@ -295,6 +327,10 @@ "en": "Three points on ellipsis", | ||
}, | ||
"ru/punctuation/quot": { | ||
"ru/punctuation/quote": { | ||
"en": "Placement of quotation marks", | ||
"ru": "Расстановка кавычек" | ||
}, | ||
"ru/space/afterHellip": { | ||
"en": "Space after ..., !.. and ?..", | ||
"ru": "Пробел после ..., !.. и ?.." | ||
}, | ||
"ru/space/year": { | ||
@@ -301,0 +337,0 @@ "en": "Space between number and word “год”", |
{ | ||
"common/html/e-mail": { | ||
"en": "Placement of links for e-mail", | ||
"ru": "Расстановка ссылок для эл. почты" | ||
}, | ||
"common/html/escape": { | ||
@@ -6,6 +10,2 @@ "en": "Escaping HTML", | ||
}, | ||
"common/html/mail": { | ||
"en": "Placement of links for e-mail", | ||
"ru": "Расстановка ссылок для эл. почты" | ||
}, | ||
"common/html/nbr": { | ||
@@ -31,3 +31,3 @@ "en": "Replacement line break on <br/>", | ||
}, | ||
"common/nbsp/afterPara": { | ||
"common/nbsp/afterParagraph": { | ||
"en": "Non-breaking space after §", | ||
@@ -45,4 +45,4 @@ "ru": "Нераз. пробел после §" | ||
"common/nbsp/dpi": { | ||
"en": "Non-breaking space before lpi, dpi", | ||
"ru": "Нераз. пробел перед lpi, dpi" | ||
"en": "Non-breaking space before lpi and dpi", | ||
"ru": "Нераз. пробел перед lpi и dpi" | ||
}, | ||
@@ -78,8 +78,2 @@ "common/nbsp/nowrap": { | ||
}, | ||
"common/punctuation/exclamation": { | ||
"common": "!! → !" | ||
}, | ||
"common/punctuation/exclamationQuestion": { | ||
"common": "!? → ?!" | ||
}, | ||
"common/space/afterPunctuation": { | ||
@@ -94,4 +88,4 @@ "en": "space after punctuation", | ||
"common/space/bracket": { | ||
"en": "Remove spaces inside brackets", | ||
"ru": "Удаление лишних пробелов внутри скобок" | ||
"en": "Remove extra spaces after opening and before closing bracket", | ||
"ru": "Удаление лишних пробелов после открывающей и перед закрывающей скобки" | ||
}, | ||
@@ -111,4 +105,4 @@ "common/space/delBeforePercent": { | ||
"common/space/delRepeatN": { | ||
"en": "Remove duplicate line breaks (no more than two)", | ||
"ru": "Удаление повторяющихся переносов строки (не более двух)" | ||
"en": "Remove duplicate line breaks (three or more)", | ||
"ru": "Удаление повторяющихся переносов строки (от трёх и более)" | ||
}, | ||
@@ -128,4 +122,4 @@ "common/space/delRepeatSpace": { | ||
"common/space/squareBracket": { | ||
"en": "Remove spaces inside square brackets", | ||
"ru": "Удаление лишних пробелов внутри квадратных скобок" | ||
"en": "Remove extra spaces after opening and before closing square bracket", | ||
"ru": "Удаление лишних пробелов после открывающей и перед закрывающей квадратной скобки" | ||
}, | ||
@@ -140,35 +134,51 @@ "common/space/trimLeft": { | ||
}, | ||
"common/sym/arrow": { | ||
"common/symbols/arrow": { | ||
"common": "-> → →, <- → ←" | ||
}, | ||
"common/sym/cf": { | ||
"common/symbols/cf": { | ||
"en": "Adding ° to C and F", | ||
"ru": "Добавление ° к C и F" | ||
}, | ||
"common/sym/copy": { | ||
"common/symbols/copy": { | ||
"common": "(c) → ©, (tm) → ™, (r) → ®" | ||
}, | ||
"en/punctuation/quot": { | ||
"en/punctuation/quote": { | ||
"en": "Placement of quotation marks", | ||
"ru": "Расстановка кавычек" | ||
}, | ||
"ru/dash/centuries": { | ||
"en": "Hyphen to dash in centuries", | ||
"ru": "Замена дефиса на тире в веках" | ||
}, | ||
"ru/dash/daysMonth": { | ||
"en": "Dash between days of one month", | ||
"ru": "Тире между днями одного месяца" | ||
}, | ||
"ru/dash/decade": { | ||
"en": "Dash in decade", | ||
"ru": "Тире в десятилетиях, 80—90-е гг." | ||
}, | ||
"ru/dash/directSpeech": { | ||
"en": "Dash in direct speech", | ||
"ru": "Тире в прямой речи" | ||
}, | ||
"ru/dash/izpod": { | ||
"en": "Hyphen between “из-под”", | ||
"ru": "Дефис между из-под" | ||
"ru": "Дефис между «из-под»" | ||
}, | ||
"ru/dash/izza": { | ||
"en": "Hyphen between “из-за”", | ||
"ru": "Дефис между из-за" | ||
"ru": "Дефис между «из-за»" | ||
}, | ||
"ru/dash/kade": { | ||
"en": "Hyphen before “ка, де, кась”", | ||
"ru": "Дефис перед ка, де, кась" | ||
"ru": "Дефис перед «ка», «де», «кась»" | ||
}, | ||
"ru/dash/koe": { | ||
"en": "Hyphen after “кое” and “кой”", | ||
"ru": "Дефис после кое и кой" | ||
"ru": "Дефис после «кое» и «кой»" | ||
}, | ||
"ru/dash/main": { | ||
"en": "Replacement hyphen with dash", | ||
"ru": "Дефис на тире" | ||
"ru": "Замена дефиса на тире" | ||
}, | ||
@@ -179,9 +189,17 @@ "ru/dash/month": { | ||
}, | ||
"ru/dash/surname": { | ||
"en": "Acronyms with a dash", | ||
"ru": "Сокращения с помощью тире" | ||
}, | ||
"ru/dash/taki": { | ||
"en": "Hyphen between “верно-таки” and etc.", | ||
"ru": "Дефис между верно-таки и т.д." | ||
"ru": "Дефис между «верно-таки» и т. д." | ||
}, | ||
"ru/dash/time": { | ||
"en": "Dash in time intervals", | ||
"ru": "Тире в интервалах времени" | ||
}, | ||
"ru/dash/to": { | ||
"en": "Hyphen before “то, либо, нибудь”", | ||
"ru": "Дефис перед то, либо, нибудь" | ||
"en": "Hyphen before “то”, “либо”, “нибудь”", | ||
"ru": "Дефис перед «то», «либо», «нибудь»" | ||
}, | ||
@@ -192,3 +210,7 @@ "ru/dash/weekday": { | ||
}, | ||
"ru/date/main": { | ||
"ru/dash/years": { | ||
"en": "Hyphen to dash in years", | ||
"ru": "Замена дефиса на тире в годах" | ||
}, | ||
"ru/date/fromISO": { | ||
"en": "Converting dates YYYY-MM-DD type DD.MM.YYYY", | ||
@@ -211,3 +233,3 @@ "ru": "Преобразование дат YYYY-MM-DD к виду DD.MM.YYYY" | ||
"en": "Non-breaking space in abbreviations, e.g. “т. д.”", | ||
"ru": "Нераз. пробел в сокращениях, например, в т. д." | ||
"ru": "Нераз. пробел в сокращениях, например, в “т. д.”" | ||
}, | ||
@@ -223,8 +245,8 @@ "ru/nbsp/addr": { | ||
"ru/nbsp/beforeParticle": { | ||
"en": "Non-breaking space before “ли, ль, же, бы, б”", | ||
"ru": "Нераз. пробел перед ли, ль, же, бы, б" | ||
"en": "Non-breaking space before “ли”, “ль”, “же”, “бы”, “б”", | ||
"ru": "Нераз. пробел перед «ли», «ль», «же», «бы», «б»" | ||
}, | ||
"ru/nbsp/cc": { | ||
"en": "Remove spaces and extra points in centuries", | ||
"ru": "Удаление пробелов и лишних точек в вв." | ||
"ru/nbsp/centuries": { | ||
"en": "Remove spaces and extra points in “вв.”", | ||
"ru": "Удаление пробелов и лишних точек в «вв.»" | ||
}, | ||
@@ -244,4 +266,4 @@ "ru/nbsp/dayMonth": { | ||
"ru/nbsp/page": { | ||
"en": "Non-breaking space before “стр., гл., рис., илл.”", | ||
"ru": "Нераз. пробел перед стр., гл., рис., илл." | ||
"en": "Non-breaking space after “стр.”, “гл.”, “рис.”, “илл.”", | ||
"ru": "Нераз. пробел после «стр.», «гл.», «рис.», «илл.»" | ||
}, | ||
@@ -252,7 +274,11 @@ "ru/nbsp/ps": { | ||
}, | ||
"ru/nbsp/xxxx": { | ||
"ru/nbsp/see": { | ||
"en": "Non-breaking space after abbreviation «см.» and «им.»", | ||
"ru": "Нераз. пробел после сокращений «см.» и «им.»" | ||
}, | ||
"ru/nbsp/year": { | ||
"en": "Non-breaking space before XXXX г. (2012 г.)", | ||
"ru": "Нераз. пробел после XXXX г. (2012 г.)" | ||
}, | ||
"ru/nbsp/yy": { | ||
"ru/nbsp/years": { | ||
"en": "г.г. → гг. and non-breaking space", | ||
@@ -272,3 +298,3 @@ "ru": "г.г. → гг. и нераз. пробел" | ||
}, | ||
"ru/optalign/quot": { | ||
"ru/optalign/quote": { | ||
"en": "for opening quotation marks", | ||
@@ -278,8 +304,8 @@ "ru": "для открывающей кавычки" | ||
"ru/other/accent": { | ||
"en": "Replacing capital letter and adding accents", | ||
"ru": "Замена заглавной буквы и добавление знака ударения" | ||
"en": "Replacement capital letters to lowercase with addition of accent", | ||
"ru": "Замена заглавной буквы на строчную с добавлением ударения" | ||
}, | ||
"ru/punctuation/ano": { | ||
"en": "Placement of commas before “а” and “но”", | ||
"ru": "Расстановка запятых перед а и но" | ||
"ru": "Расстановка запятых перед «а» и «но»" | ||
}, | ||
@@ -290,2 +316,8 @@ "ru/punctuation/apostrophe": { | ||
}, | ||
"ru/punctuation/exclamation": { | ||
"common": "!! → !" | ||
}, | ||
"ru/punctuation/exclamationQuestion": { | ||
"common": "!? → ?!" | ||
}, | ||
"ru/punctuation/hellip": { | ||
@@ -295,6 +327,10 @@ "en": "Three points on ellipsis", | ||
}, | ||
"ru/punctuation/quot": { | ||
"ru/punctuation/quote": { | ||
"en": "Placement of quotation marks", | ||
"ru": "Расстановка кавычек" | ||
}, | ||
"ru/space/afterHellip": { | ||
"en": "Space after ..., !.. and ?..", | ||
"ru": "Пробел после ..., !.. и ?.." | ||
}, | ||
"ru/space/year": { | ||
@@ -301,0 +337,0 @@ "en": "Space between number and word “год”", |
@@ -5,66 +5,84 @@ ## Rules of typograf in order of execution | ||
|--:|-----------------------|-------|--------:|:-----:|:--:| | ||
| 1. | [common/sym/copy](../src/rules/common/sym/copy.js) | (c) → ©, (tm) → ©, (r) → ™ | 10 | | ✓ | | ||
| 2. | [common/punctuation/hellip](../src/rules/common/punctuation/hellip.js) | Три точки на троеточие | 20 | | ✓ | | ||
| 3. | [ru/dash/to](../src/rules/ru/dash/to.js) | Дефис перед то, либо, нибудь | 30 | | ✓ | | ||
| 4. | [ru/dash/kade](../src/rules/ru/dash/kade.js) | Дефис перед ка, де, кась | 31 | | ✓ | | ||
| 5. | [ru/dash/izza](../src/rules/ru/dash/izza.js) | Дефис между из-за | 33 | | ✓ | | ||
| 6. | [ru/dash/izpod](../src/rules/ru/dash/izpod.js) | Дефис между из-под | 35 | | ✓ | | ||
| 7. | [ru/dash/koe](../src/rules/ru/dash/koe.js) | Дефис после кое и кой | 38 | | ✓ | | ||
| 8. | [ru/dash/taki](../src/rules/ru/dash/taki.js) | Дефис между верно-таки и т.д. | 39 | | ✓ | | ||
| 9. | [common/space/delLeadingBlanks](../src/rules/common/space/delLeadingBlanks.js) | Удаление пробелов в начале строки | 504 | | | | ||
| 10. | [common/space/delTrailingBlanks](../src/rules/common/space/delTrailingBlanks.js) | Удаление пробелов в конце строки | 505 | | ✓ | | ||
| 11. | [common/space/replaceTab](../src/rules/common/space/replaceTab.js) | Замена таба на 4 пробела | 510 | | ✓ | | ||
| 12. | [common/space/trimLeft](../src/rules/common/space/trimLeft.js) | Удаление пробелов и переносов строк в начале текста | 530 | | ✓ | | ||
| 13. | [common/space/trimRight](../src/rules/common/space/trimRight.js) | Удаление пробелов и переносов строк в конце текста | 535 | | ✓ | | ||
| 14. | [common/space/delRepeatSpace](../src/rules/common/space/delRepeatSpace.js) | Удаление повторяющихся пробелов между символами | 540 | | ✓ | | ||
| 15. | [common/space/delRepeatN](../src/rules/common/space/delRepeatN.js) | Удаление повторяющихся переносов строки (не более двух) | 545 | | ✓ | | ||
| 16. | [common/space/delBeforePunctuation](../src/rules/common/space/delBeforePunctuation.js) | Удаление пробелов перед знаками пунктуации | 550 | | ✓ | | ||
| 17. | [common/space/afterPunctuation](../src/rules/common/space/afterPunctuation.js) | Пробел после знаков пунктуации | 560 | | ✓ | | ||
| 18. | [ru/other/accent](../src/rules/ru/other/accent.js) | Замена заглавной буквы и добавление знака ударения | 560 | | | | ||
| 19. | [ru/nbsp/beforeParticle](../src/rules/ru/nbsp/beforeParticle.js) | Нераз. пробел перед ли, ль, же, бы, б | 570 | | ✓ | | ||
| 20. | [common/punctuation/delDoublePunctuation](../src/rules/common/punctuation/delDoublePunctuation.js) | Удаление двойной пунктуации | 580 | | ✓ | | ||
| 21. | [common/nbsp/afterShortWord](../src/rules/common/nbsp/afterShortWord.js) | Нераз. пробел после короткого слова | 590 | | ✓ | | ||
| 22. | [common/space/delBeforePercent](../src/rules/common/space/delBeforePercent.js) | Удаление пробела перед %, ‰ и ‱ | 600 | | ✓ | | ||
| 23. | [ru/dash/weekday](../src/rules/ru/dash/weekday.js) | Тире между днями недели | 600 | | ✓ | | ||
| 24. | [ru/dash/month](../src/rules/ru/dash/month.js) | Тире между месяцами | 610 | | ✓ | | ||
| 25. | [common/nbsp/afterPara](../src/rules/common/nbsp/afterPara.js) | Нераз. пробел после § | 610 | | ✓ | | ||
| 26. | [ru/nbsp/afterNumberSign](../src/rules/ru/nbsp/afterNumberSign.js) | Нераз. пробел после № | 610 | | ✓ | | ||
| 27. | [ru/nbsp/page](../src/rules/ru/nbsp/page.js) | Нераз. пробел перед стр., гл., рис., илл. | 610 | | ✓ | | ||
| 28. | [common/nbsp/afterNumber](../src/rules/common/nbsp/afterNumber.js) | Нераз. пробел между числом и словом | 615 | | ✓ | | ||
| 29. | [ru/dash/main](../src/rules/ru/dash/main.js) | Дефис на тире | 620 | | ✓ | | ||
| 30. | [common/nbsp/beforeShortLastWord](../src/rules/common/nbsp/beforeShortLastWord.js) | Нераз. пробел перед последним коротким словом в предложении | 620 | | ✓ | | ||
| 31. | [ru/punctuation/quot](../src/rules/ru/punctuation/quot.js) | Расстановка кавычек | 700 | | ✓ | | ||
| 32. | [en/punctuation/quot](../src/rules/en/punctuation/quot.js) | Расстановка кавычек | 700 | | ✓ | | ||
| 33. | [ru/optalign/quot](../src/rules/ru/optalign/quot.js) | для открывающей кавычки | 1000 | | | | ||
| 34. | [ru/optalign/bracket](../src/rules/ru/optalign/bracket.js) | для открывающей скобки | 1001 | | | | ||
| 35. | [ru/optalign/comma](../src/rules/ru/optalign/comma.js) | для запятой | 1002 | | | | ||
| 36. | [common/number/plusMinus](../src/rules/common/number/plusMinus.js) | +- → ± | 1010 | | ✓ | | ||
| 37. | [common/sym/cf](../src/rules/common/sym/cf.js) | Добавление ° к C и F | 1020 | | ✓ | | ||
| 38. | [ru/nbsp/m](../src/rules/ru/nbsp/m.js) | m2 → м², m3 → м³ и нераз. пробел | 1030 | | ✓ | | ||
| 39. | [common/number/times](../src/rules/common/number/times.js) | x → × (10 x 5 → 10×5) | 1050 | | ✓ | | ||
| 40. | [ru/nbsp/xxxx](../src/rules/ru/nbsp/xxxx.js) | Нераз. пробел после XXXX г. (2012 г.) | 1060 | | ✓ | | ||
| 41. | [ru/nbsp/yy](../src/rules/ru/nbsp/yy.js) | г.г. → гг. и нераз. пробел | 1080 | | ✓ | | ||
| 42. | [ru/nbsp/cc](../src/rules/ru/nbsp/cc.js) | Удаление пробелов и лишних точек в вв. | 1090 | | ✓ | | ||
| 43. | [ru/nbsp/ooo](../src/rules/ru/nbsp/ooo.js) | Нераз. пробел после OOO, ОАО, ЗАО, НИИ и ПБОЮЛ | 1100 | | ✓ | | ||
| 44. | [ru/nbsp/dayMonth](../src/rules/ru/nbsp/dayMonth.js) | Нераз. пробел между числом и месяцем | 1105 | | ✓ | | ||
| 45. | [ru/nbsp/but](../src/rules/ru/nbsp/but.js) | Расстановка запятых и неразрывного пробела перед а и но | 1110 | | ✓ | | ||
| 46. | [ru/nbsp/addr](../src/rules/ru/nbsp/addr.js) | Расстановка неразрывного пробела после «г.», «обл.», «ул.», «пр.», «кв.» и др. | 1115 | | ✓ | | ||
| 47. | [common/number/fraction](../src/rules/common/number/fraction.js) | 1/2 → ½, 1/4 → ¼, 3/3 → ¾ | 1120 | | ✓ | | ||
| 48. | [common/sym/arrow](../src/rules/common/sym/arrow.js) | -> → →, <- → ← | 1130 | | ✓ | | ||
| 49. | [common/punctuation/exclamationQuestion](../src/rules/common/punctuation/exclamationQuestion.js) | !? → ?! | 1140 | | ✓ | | ||
| 50. | [ru/money/euro](../src/rules/ru/money/euro.js) | €100 → 100 € | 1140 | | ✓ | | ||
| 51. | [ru/money/dollar](../src/rules/ru/money/dollar.js) | $100 → 100 $ | 1140 | | ✓ | | ||
| 52. | [ru/money/ruble](../src/rules/ru/money/ruble.js) | 1 руб. → 1 ₽ | 1145 | | | | ||
| 53. | [common/nbsp/dpi](../src/rules/common/nbsp/dpi.js) | Нераз. пробел перед lpi, dpi | 1150 | | ✓ | | ||
| 54. | [common/punctuation/exclamation](../src/rules/common/punctuation/exclamation.js) | !! → ! | 1150 | | ✓ | | ||
| 55. | [common/other/repeatWord](../src/rules/common/other/repeatWord.js) | Удаление повтора слова | 1200 | | | | ||
| 56. | [ru/date/main](../src/rules/ru/date/main.js) | Преобразование дат YYYY-MM-DD к виду DD.MM.YYYY | 1300 | | ✓ | | ||
| 57. | [ru/number/ordinals](../src/rules/ru/number/ordinals.js) | N-ый, -ой, -ая, -ое, -ые, -ым, -ом, -ых → N-й, -я, -е, -м, -х (25-й) | 1300 | | ✓ | | ||
| 58. | [ru/date/weekday](../src/rules/ru/date/weekday.js) | 2 Мая, Понедельник → 2 мая, понедельник | 1310 | | ✓ | | ||
| 59. | [common/nbsp/nowrap](../src/rules/common/nbsp/nowrap.js) | Заменять нераз. пробел на обычный пробел в тегах nowrap и nobr | 1400 | | ✓ | | ||
| 60. | [common/html/mail](../src/rules/common/html/mail.js) | Расстановка ссылок для эл. почты | 2000 | | | | ||
| 61. | [common/html/url](../src/rules/common/html/url.js) | Расстановка ссылок | 2010 | | | | ||
| 62. | [common/html/nbr](../src/rules/common/html/nbr.js) | Замена перевода строки на тег br | 2020 | | | | ||
| 63. | [common/html/pbr](../src/rules/common/html/pbr.js) | Расстановка тегов p и br | 2030 | | | | ||
| 64. | [common/html/stripTags](../src/rules/common/html/stripTags.js) | Удаление HTML-тегов | 100 | end | | | ||
| 65. | [common/html/escape](../src/rules/common/html/escape.js) | Экранирование HTML | 110 | end | | | ||
| 1. | [common/other/delBOM](../src/rules/common/other/delBOM.js) | Delete character BOM (Byte Order Mark) | -1 | start | ✓ | | ||
| 2. | [common/nbsp/replaceNbsp](../src/rules/common/nbsp/replaceNbsp.js) | Replacing non-breaking space in the ordinary | 510 | utf | ✓ | | ||
| 3. | [common/symbols/copy](../src/rules/common/symbols/copy.js) | (c) → ©, (tm) → ™, (r) → ® | 110 | | ✓ | | ||
| 4. | [common/symbols/arrow](../src/rules/common/symbols/arrow.js) | -> → →, <- → ← | 110 | | ✓ | | ||
| 5. | [common/symbols/cf](../src/rules/common/symbols/cf.js) | Adding ° to C and F | 110 | | ✓ | | ||
| 6. | [common/space/replaceTab](../src/rules/common/space/replaceTab.js) | Replacement of tab to 4 spaces | 205 | | ✓ | | ||
| 7. | [common/space/trimLeft](../src/rules/common/space/trimLeft.js) | Remove spaces and line breaks in beginning of text | 206 | | ✓ | | ||
| 8. | [common/space/delTrailingBlanks](../src/rules/common/space/delTrailingBlanks.js) | Remove spaces at end of line | 207 | | ✓ | | ||
| 9. | [common/space/trimRight](../src/rules/common/space/trimRight.js) | Remove spaces and line breaks at end of text | 207 | | ✓ | | ||
| 10. | [common/space/delRepeatN](../src/rules/common/space/delRepeatN.js) | Remove duplicate line breaks (three or more) | 209 | | ✓ | | ||
| 11. | [common/space/delRepeatSpace](../src/rules/common/space/delRepeatSpace.js) | Removing duplicate spaces between characters | 209 | | ✓ | | ||
| 12. | [ru/space/year](../src/rules/ru/space/year.js) | Space between number and word “год” | 210 | | ✓ | | ||
| 13. | [common/space/afterPunctuation](../src/rules/common/space/afterPunctuation.js) | space after punctuation | 210 | | ✓ | | ||
| 14. | [common/space/beforeBracket](../src/rules/common/space/beforeBracket.js) | Space before opening bracket | 210 | | ✓ | | ||
| 15. | [common/space/bracket](../src/rules/common/space/bracket.js) | Remove extra spaces after opening and before closing bracket | 210 | | ✓ | | ||
| 16. | [common/space/squareBracket](../src/rules/common/space/squareBracket.js) | Remove extra spaces after opening and before closing square bracket | 210 | | ✓ | | ||
| 17. | [common/space/delBeforePercent](../src/rules/common/space/delBeforePercent.js) | Remove space before %, ‰ and ‱ | 210 | | ✓ | | ||
| 18. | [common/space/delBeforePunctuation](../src/rules/common/space/delBeforePunctuation.js) | Remove spaces before punctuation | 210 | | ✓ | | ||
| 19. | [ru/space/afterHellip](../src/rules/ru/space/afterHellip.js) | Space after ..., !.. and ?.. | 210 | | ✓ | | ||
| 20. | [common/space/delLeadingBlanks](../src/rules/common/space/delLeadingBlanks.js) | Remove spaces at start of line | 210 | | | | ||
| 21. | [ru/dash/main](../src/rules/ru/dash/main.js) | Replacement hyphen with dash | 305 | | ✓ | | ||
| 22. | [ru/dash/taki](../src/rules/ru/dash/taki.js) | Hyphen between “верно-таки” and etc. | 310 | | ✓ | | ||
| 23. | [ru/dash/surname](../src/rules/ru/dash/surname.js) | Acronyms with a dash | 310 | | ✓ | | ||
| 24. | [ru/dash/month](../src/rules/ru/dash/month.js) | Dash between months | 310 | | ✓ | | ||
| 25. | [ru/dash/izza](../src/rules/ru/dash/izza.js) | Hyphen between “из-за” | 310 | | ✓ | | ||
| 26. | [ru/dash/koe](../src/rules/ru/dash/koe.js) | Hyphen after “кое” and “кой” | 310 | | ✓ | | ||
| 27. | [ru/dash/years](../src/rules/ru/dash/years.js) | Hyphen to dash in years | 310 | | ✓ | | ||
| 28. | [ru/dash/kade](../src/rules/ru/dash/kade.js) | Hyphen before “ка, де, кась” | 310 | | ✓ | | ||
| 29. | [ru/dash/izpod](../src/rules/ru/dash/izpod.js) | Hyphen between “из-под” | 310 | | ✓ | | ||
| 30. | [ru/dash/directSpeech](../src/rules/ru/dash/directSpeech.js) | Dash in direct speech | 310 | | ✓ | | ||
| 31. | [ru/dash/weekday](../src/rules/ru/dash/weekday.js) | Dash between the days of the week | 310 | | ✓ | | ||
| 32. | [ru/dash/decade](../src/rules/ru/dash/decade.js) | Dash in decade | 310 | | ✓ | | ||
| 33. | [ru/dash/daysMonth](../src/rules/ru/dash/daysMonth.js) | Dash between days of one month | 310 | | ✓ | | ||
| 34. | [ru/dash/to](../src/rules/ru/dash/to.js) | Hyphen before “то”, “либо”, “нибудь” | 310 | | ✓ | | ||
| 35. | [ru/dash/time](../src/rules/ru/dash/time.js) | Dash in time intervals | 310 | | ✓ | | ||
| 36. | [ru/dash/centuries](../src/rules/ru/dash/centuries.js) | Hyphen to dash in centuries | 310 | | ✓ | | ||
| 37. | [ru/punctuation/apostrophe](../src/rules/ru/punctuation/apostrophe.js) | Placement of correct apostrophe | 405 | | ✓ | | ||
| 38. | [en/punctuation/quote](../src/rules/en/punctuation/quote.js) | Placement of quotation marks | 410 | | ✓ | | ||
| 39. | [ru/punctuation/quote](../src/rules/ru/punctuation/quote.js) | Placement of quotation marks | 410 | | ✓ | | ||
| 40. | [ru/punctuation/hellip](../src/rules/ru/punctuation/hellip.js) | Three points on ellipsis | 410 | | ✓ | | ||
| 41. | [ru/punctuation/exclamation](../src/rules/ru/punctuation/exclamation.js) | !! → ! | 410 | | ✓ | | ||
| 42. | [ru/punctuation/ano](../src/rules/ru/punctuation/ano.js) | Placement of commas before “а” and “но” | 410 | | ✓ | | ||
| 43. | [common/punctuation/delDoublePunctuation](../src/rules/common/punctuation/delDoublePunctuation.js) | Removing double punctuation | 410 | | ✓ | | ||
| 44. | [ru/punctuation/exclamationQuestion](../src/rules/ru/punctuation/exclamationQuestion.js) | !? → ?! | 415 | | ✓ | | ||
| 45. | [common/nbsp/dpi](../src/rules/common/nbsp/dpi.js) | Non-breaking space before lpi and dpi | 510 | | ✓ | | ||
| 46. | [common/nbsp/beforeShortLastWord](../src/rules/common/nbsp/beforeShortLastWord.js) | Non-breaking space before last short word in sentence | 510 | | ✓ | | ||
| 47. | [common/nbsp/afterShortWord](../src/rules/common/nbsp/afterShortWord.js) | Non-breaking space after short word | 510 | | ✓ | | ||
| 48. | [common/nbsp/afterParagraph](../src/rules/common/nbsp/afterParagraph.js) | Non-breaking space after § | 510 | | ✓ | | ||
| 49. | [common/nbsp/afterNumber](../src/rules/common/nbsp/afterNumber.js) | Non-breaking space between number and word | 510 | | | | ||
| 50. | [ru/nbsp/year](../src/rules/ru/nbsp/year.js) | Non-breaking space before XXXX г. (2012 г.) | 510 | | ✓ | | ||
| 51. | [ru/nbsp/see](../src/rules/ru/nbsp/see.js) | Non-breaking space after abbreviation «см.» and «им.» | 510 | | ✓ | | ||
| 52. | [ru/nbsp/ps](../src/rules/ru/nbsp/ps.js) | Non-breaking space in P. S. and P. P. S. | 510 | | ✓ | | ||
| 53. | [ru/nbsp/page](../src/rules/ru/nbsp/page.js) | Non-breaking space after “стр.”, “гл.”, “рис.”, “илл.” | 510 | | ✓ | | ||
| 54. | [ru/nbsp/ooo](../src/rules/ru/nbsp/ooo.js) | Non-breaking space after “OOO, ОАО, ЗАО, НИИ, ПБОЮЛ” | 510 | | ✓ | | ||
| 55. | [ru/nbsp/dayMonth](../src/rules/ru/nbsp/dayMonth.js) | Non-breaking space between number and month | 510 | | ✓ | | ||
| 56. | [ru/nbsp/centuries](../src/rules/ru/nbsp/centuries.js) | Remove spaces and extra points in “вв.” | 510 | | ✓ | | ||
| 57. | [ru/nbsp/afterNumberSign](../src/rules/ru/nbsp/afterNumberSign.js) | Non-breaking space after № | 510 | | ✓ | | ||
| 58. | [ru/nbsp/abbr](../src/rules/ru/nbsp/abbr.js) | Non-breaking space in abbreviations, e.g. “т. д.” | 510 | | ✓ | | ||
| 59. | [ru/nbsp/addr](../src/rules/ru/nbsp/addr.js) | Placement of non-breaking space after “г.”, “обл.”, “ул.”, “пр.”, “кв.” et al. | 510 | | ✓ | | ||
| 60. | [ru/nbsp/beforeParticle](../src/rules/ru/nbsp/beforeParticle.js) | Non-breaking space before “ли”, “ль”, “же”, “бы”, “б” | 515 | | ✓ | | ||
| 61. | [ru/nbsp/m](../src/rules/ru/nbsp/m.js) | m2 → м², m3 → м³ and non-breaking space | 515 | | ✓ | | ||
| 62. | [ru/nbsp/years](../src/rules/ru/nbsp/years.js) | г.г. → гг. and non-breaking space | 515 | | ✓ | | ||
| 63. | [common/number/times](../src/rules/common/number/times.js) | x → × (10 x 5 → 10×5) | 610 | | ✓ | | ||
| 64. | [ru/number/ordinals](../src/rules/ru/number/ordinals.js) | N-ый, -ой, -ая, -ое, -ые, -ым, -ом, -ых → N-й, -я, -е, -м, -х (25-й) | 610 | | ✓ | | ||
| 65. | [common/number/fraction](../src/rules/common/number/fraction.js) | 1/2 → ½, 1/4 → ¼, 3/3 → ¾ | 610 | | ✓ | | ||
| 66. | [common/number/mathSigns](../src/rules/common/number/mathSigns.js) | != → ≠, <= → ≤, >= → ≥, ~= → ≅, +- → ± | 610 | | ✓ | | ||
| 67. | [ru/money/euro](../src/rules/ru/money/euro.js) | €100 → 100 € | 710 | | ✓ | | ||
| 68. | [ru/money/dollar](../src/rules/ru/money/dollar.js) | $100 → 100 $ | 710 | | ✓ | | ||
| 69. | [ru/money/ruble](../src/rules/ru/money/ruble.js) | 1 руб. → 1 ₽ | 710 | | | | ||
| 70. | [ru/date/fromISO](../src/rules/ru/date/fromISO.js) | Converting dates YYYY-MM-DD type DD.MM.YYYY | 810 | | ✓ | | ||
| 71. | [ru/date/weekday](../src/rules/ru/date/weekday.js) | 2 Мая, Понедельник → 2 мая, понедельник | 810 | | ✓ | | ||
| 72. | [common/other/repeatWord](../src/rules/common/other/repeatWord.js) | Removing repeat words | 910 | | | | ||
| 73. | [ru/other/accent](../src/rules/ru/other/accent.js) | Replacement capital letters to lowercase with addition of accent | 910 | | | | ||
| 74. | [ru/optalign/quote](../src/rules/ru/optalign/quote.js) | for opening quotation marks | 1010 | | | | ||
| 75. | [ru/optalign/bracket](../src/rules/ru/optalign/bracket.js) | for opening bracket | 1010 | | | | ||
| 76. | [ru/optalign/comma](../src/rules/ru/optalign/comma.js) | for comma | 1010 | | | | ||
| 77. | [common/html/url](../src/rules/common/html/url.js) | Placement of links | 1110 | | | | ||
| 78. | [common/html/e-mail](../src/rules/common/html/e-mail.js) | Placement of links for e-mail | 1110 | | | | ||
| 79. | [common/nbsp/nowrap](../src/rules/common/nbsp/nowrap.js) | Replace non-breaking space to normal space in tags nowrap and nobr | 510 | end | ✓ | | ||
| 80. | [common/html/pbr](../src/rules/common/html/pbr.js) | Placement of p and br tags | 1110 | end | | | ||
| 81. | [common/html/nbr](../src/rules/common/html/nbr.js) | Replacement line break on <br/> | 1115 | end | | | ||
| 82. | [common/html/stripTags](../src/rules/common/html/stripTags.js) | Removing HTML-tags | 1209 | end | | | ||
| 83. | [common/html/escape](../src/rules/common/html/escape.js) | Escaping HTML | 1210 | end | | |
## Правила типографа по порядку выполнения | ||
| № | [Имя](./RULES.md) | Название | Индекс ▼ | Очередь | Вкл. | | ||
| № | [Имя](./RULES.ru.md) | Название | Индекс ▼ | Очередь | Вкл. | | ||
|--:|-------------------|----------|---------:|:-------:|:----:| | ||
| 1. | [common/sym/copy](../src/rules/common/sym/copy.js) | (c) → ©, (tm) → ©, (r) → ™ | 10 | | ✓ | | ||
| 2. | [common/punctuation/hellip](../src/rules/common/punctuation/hellip.js) | Три точки на троеточие | 20 | | ✓ | | ||
| 3. | [ru/dash/to](../src/rules/ru/dash/to.js) | Дефис перед то, либо, нибудь | 30 | | ✓ | | ||
| 4. | [ru/dash/kade](../src/rules/ru/dash/kade.js) | Дефис перед ка, де, кась | 31 | | ✓ | | ||
| 5. | [ru/dash/izza](../src/rules/ru/dash/izza.js) | Дефис между из-за | 33 | | ✓ | | ||
| 6. | [ru/dash/izpod](../src/rules/ru/dash/izpod.js) | Дефис между из-под | 35 | | ✓ | | ||
| 7. | [ru/dash/koe](../src/rules/ru/dash/koe.js) | Дефис после кое и кой | 38 | | ✓ | | ||
| 8. | [ru/dash/taki](../src/rules/ru/dash/taki.js) | Дефис между верно-таки и т.д. | 39 | | ✓ | | ||
| 9. | [common/space/delLeadingBlanks](../src/rules/common/space/delLeadingBlanks.js) | Удаление пробелов в начале строки | 504 | | | | ||
| 10. | [common/space/delTrailingBlanks](../src/rules/common/space/delTrailingBlanks.js) | Удаление пробелов в конце строки | 505 | | ✓ | | ||
| 11. | [common/space/replaceTab](../src/rules/common/space/replaceTab.js) | Замена таба на 4 пробела | 510 | | ✓ | | ||
| 12. | [common/space/trimLeft](../src/rules/common/space/trimLeft.js) | Удаление пробелов и переносов строк в начале текста | 530 | | ✓ | | ||
| 13. | [common/space/trimRight](../src/rules/common/space/trimRight.js) | Удаление пробелов и переносов строк в конце текста | 535 | | ✓ | | ||
| 14. | [common/space/delRepeatSpace](../src/rules/common/space/delRepeatSpace.js) | Удаление повторяющихся пробелов между символами | 540 | | ✓ | | ||
| 15. | [common/space/delRepeatN](../src/rules/common/space/delRepeatN.js) | Удаление повторяющихся переносов строки (не более двух) | 545 | | ✓ | | ||
| 16. | [common/space/delBeforePunctuation](../src/rules/common/space/delBeforePunctuation.js) | Удаление пробелов перед знаками пунктуации | 550 | | ✓ | | ||
| 17. | [common/space/afterPunctuation](../src/rules/common/space/afterPunctuation.js) | Пробел после знаков пунктуации | 560 | | ✓ | | ||
| 18. | [ru/other/accent](../src/rules/ru/other/accent.js) | Замена заглавной буквы и добавление знака ударения | 560 | | | | ||
| 19. | [ru/nbsp/beforeParticle](../src/rules/ru/nbsp/beforeParticle.js) | Нераз. пробел перед ли, ль, же, бы, б | 570 | | ✓ | | ||
| 20. | [common/punctuation/delDoublePunctuation](../src/rules/common/punctuation/delDoublePunctuation.js) | Удаление двойной пунктуации | 580 | | ✓ | | ||
| 21. | [common/nbsp/afterShortWord](../src/rules/common/nbsp/afterShortWord.js) | Нераз. пробел после короткого слова | 590 | | ✓ | | ||
| 22. | [common/space/delBeforePercent](../src/rules/common/space/delBeforePercent.js) | Удаление пробела перед %, ‰ и ‱ | 600 | | ✓ | | ||
| 23. | [ru/dash/weekday](../src/rules/ru/dash/weekday.js) | Тире между днями недели | 600 | | ✓ | | ||
| 24. | [ru/dash/month](../src/rules/ru/dash/month.js) | Тире между месяцами | 610 | | ✓ | | ||
| 25. | [common/nbsp/afterPara](../src/rules/common/nbsp/afterPara.js) | Нераз. пробел после § | 610 | | ✓ | | ||
| 26. | [ru/nbsp/afterNumberSign](../src/rules/ru/nbsp/afterNumberSign.js) | Нераз. пробел после № | 610 | | ✓ | | ||
| 27. | [ru/nbsp/page](../src/rules/ru/nbsp/page.js) | Нераз. пробел перед стр., гл., рис., илл. | 610 | | ✓ | | ||
| 28. | [common/nbsp/afterNumber](../src/rules/common/nbsp/afterNumber.js) | Нераз. пробел между числом и словом | 615 | | ✓ | | ||
| 29. | [ru/dash/main](../src/rules/ru/dash/main.js) | Дефис на тире | 620 | | ✓ | | ||
| 30. | [common/nbsp/beforeShortLastWord](../src/rules/common/nbsp/beforeShortLastWord.js) | Нераз. пробел перед последним коротким словом в предложении | 620 | | ✓ | | ||
| 31. | [ru/punctuation/quot](../src/rules/ru/punctuation/quot.js) | Расстановка кавычек | 700 | | ✓ | | ||
| 32. | [en/punctuation/quot](../src/rules/en/punctuation/quot.js) | Расстановка кавычек | 700 | | ✓ | | ||
| 33. | [ru/optalign/quot](../src/rules/ru/optalign/quot.js) | для открывающей кавычки | 1000 | | | | ||
| 34. | [ru/optalign/bracket](../src/rules/ru/optalign/bracket.js) | для открывающей скобки | 1001 | | | | ||
| 35. | [ru/optalign/comma](../src/rules/ru/optalign/comma.js) | для запятой | 1002 | | | | ||
| 36. | [common/number/plusMinus](../src/rules/common/number/plusMinus.js) | +- → ± | 1010 | | ✓ | | ||
| 37. | [common/sym/cf](../src/rules/common/sym/cf.js) | Добавление ° к C и F | 1020 | | ✓ | | ||
| 38. | [ru/nbsp/m](../src/rules/ru/nbsp/m.js) | m2 → м², m3 → м³ и нераз. пробел | 1030 | | ✓ | | ||
| 39. | [common/number/times](../src/rules/common/number/times.js) | x → × (10 x 5 → 10×5) | 1050 | | ✓ | | ||
| 40. | [ru/nbsp/xxxx](../src/rules/ru/nbsp/xxxx.js) | Нераз. пробел после XXXX г. (2012 г.) | 1060 | | ✓ | | ||
| 41. | [ru/nbsp/yy](../src/rules/ru/nbsp/yy.js) | г.г. → гг. и нераз. пробел | 1080 | | ✓ | | ||
| 42. | [ru/nbsp/cc](../src/rules/ru/nbsp/cc.js) | Удаление пробелов и лишних точек в вв. | 1090 | | ✓ | | ||
| 43. | [ru/nbsp/ooo](../src/rules/ru/nbsp/ooo.js) | Нераз. пробел после OOO, ОАО, ЗАО, НИИ и ПБОЮЛ | 1100 | | ✓ | | ||
| 44. | [ru/nbsp/dayMonth](../src/rules/ru/nbsp/dayMonth.js) | Нераз. пробел между числом и месяцем | 1105 | | ✓ | | ||
| 45. | [ru/nbsp/but](../src/rules/ru/nbsp/but.js) | Расстановка запятых и неразрывного пробела перед а и но | 1110 | | ✓ | | ||
| 46. | [ru/nbsp/addr](../src/rules/ru/nbsp/addr.js) | Расстановка неразрывного пробела после «г.», «обл.», «ул.», «пр.», «кв.» и др. | 1115 | | ✓ | | ||
| 47. | [common/number/fraction](../src/rules/common/number/fraction.js) | 1/2 → ½, 1/4 → ¼, 3/3 → ¾ | 1120 | | ✓ | | ||
| 48. | [common/sym/arrow](../src/rules/common/sym/arrow.js) | -> → →, <- → ← | 1130 | | ✓ | | ||
| 49. | [common/punctuation/exclamationQuestion](../src/rules/common/punctuation/exclamationQuestion.js) | !? → ?! | 1140 | | ✓ | | ||
| 50. | [ru/money/euro](../src/rules/ru/money/euro.js) | €100 → 100 € | 1140 | | ✓ | | ||
| 51. | [ru/money/dollar](../src/rules/ru/money/dollar.js) | $100 → 100 $ | 1140 | | ✓ | | ||
| 52. | [ru/money/ruble](../src/rules/ru/money/ruble.js) | 1 руб. → 1 ₽ | 1145 | | | | ||
| 53. | [common/nbsp/dpi](../src/rules/common/nbsp/dpi.js) | Нераз. пробел перед lpi, dpi | 1150 | | ✓ | | ||
| 54. | [common/punctuation/exclamation](../src/rules/common/punctuation/exclamation.js) | !! → ! | 1150 | | ✓ | | ||
| 55. | [common/other/repeatWord](../src/rules/common/other/repeatWord.js) | Удаление повтора слова | 1200 | | | | ||
| 56. | [ru/date/main](../src/rules/ru/date/main.js) | Преобразование дат YYYY-MM-DD к виду DD.MM.YYYY | 1300 | | ✓ | | ||
| 57. | [ru/number/ordinals](../src/rules/ru/number/ordinals.js) | N-ый, -ой, -ая, -ое, -ые, -ым, -ом, -ых → N-й, -я, -е, -м, -х (25-й) | 1300 | | ✓ | | ||
| 58. | [ru/date/weekday](../src/rules/ru/date/weekday.js) | 2 Мая, Понедельник → 2 мая, понедельник | 1310 | | ✓ | | ||
| 59. | [common/nbsp/nowrap](../src/rules/common/nbsp/nowrap.js) | Заменять нераз. пробел на обычный пробел в тегах nowrap и nobr | 1400 | | ✓ | | ||
| 60. | [common/html/mail](../src/rules/common/html/mail.js) | Расстановка ссылок для эл. почты | 2000 | | | | ||
| 61. | [common/html/url](../src/rules/common/html/url.js) | Расстановка ссылок | 2010 | | | | ||
| 62. | [common/html/nbr](../src/rules/common/html/nbr.js) | Замена перевода строки на тег br | 2020 | | | | ||
| 63. | [common/html/pbr](../src/rules/common/html/pbr.js) | Расстановка тегов p и br | 2030 | | | | ||
| 64. | [common/html/stripTags](../src/rules/common/html/stripTags.js) | Удаление HTML-тегов | 100 | end | | | ||
| 65. | [common/html/escape](../src/rules/common/html/escape.js) | Экранирование HTML | 110 | end | | | ||
| 1. | [common/other/delBOM](../src/rules/common/other/delBOM.js) | Удаление символа BOM (Byte Order Mark) | -1 | start | ✓ | | ||
| 2. | [common/nbsp/replaceNbsp](../src/rules/common/nbsp/replaceNbsp.js) | Замена неразрывного пробела на обычный | 510 | utf | ✓ | | ||
| 3. | [common/symbols/copy](../src/rules/common/symbols/copy.js) | (c) → ©, (tm) → ™, (r) → ® | 110 | | ✓ | | ||
| 4. | [common/symbols/arrow](../src/rules/common/symbols/arrow.js) | -> → →, <- → ← | 110 | | ✓ | | ||
| 5. | [common/symbols/cf](../src/rules/common/symbols/cf.js) | Добавление ° к C и F | 110 | | ✓ | | ||
| 6. | [common/space/replaceTab](../src/rules/common/space/replaceTab.js) | Замена таба на 4 пробела | 205 | | ✓ | | ||
| 7. | [common/space/trimLeft](../src/rules/common/space/trimLeft.js) | Удаление пробелов и переносов строк в начале текста | 206 | | ✓ | | ||
| 8. | [common/space/delTrailingBlanks](../src/rules/common/space/delTrailingBlanks.js) | Удаление пробелов в конце строки | 207 | | ✓ | | ||
| 9. | [common/space/trimRight](../src/rules/common/space/trimRight.js) | Удаление пробелов и переносов строк в конце текста | 207 | | ✓ | | ||
| 10. | [common/space/delRepeatN](../src/rules/common/space/delRepeatN.js) | Удаление повторяющихся переносов строки (от трёх и более) | 209 | | ✓ | | ||
| 11. | [common/space/delRepeatSpace](../src/rules/common/space/delRepeatSpace.js) | Удаление повторяющихся пробелов между символами | 209 | | ✓ | | ||
| 12. | [ru/space/year](../src/rules/ru/space/year.js) | Пробел между числом и словом «год» | 210 | | ✓ | | ||
| 13. | [common/space/afterPunctuation](../src/rules/common/space/afterPunctuation.js) | Пробел после знаков пунктуации | 210 | | ✓ | | ||
| 14. | [common/space/beforeBracket](../src/rules/common/space/beforeBracket.js) | Пробел перед открывающей скобкой | 210 | | ✓ | | ||
| 15. | [common/space/bracket](../src/rules/common/space/bracket.js) | Удаление лишних пробелов после открывающей и перед закрывающей скобки | 210 | | ✓ | | ||
| 16. | [common/space/squareBracket](../src/rules/common/space/squareBracket.js) | Удаление лишних пробелов после открывающей и перед закрывающей квадратной скобки | 210 | | ✓ | | ||
| 17. | [common/space/delBeforePercent](../src/rules/common/space/delBeforePercent.js) | Удаление пробела перед %, ‰ и ‱ | 210 | | ✓ | | ||
| 18. | [common/space/delBeforePunctuation](../src/rules/common/space/delBeforePunctuation.js) | Удаление пробелов перед знаками пунктуации | 210 | | ✓ | | ||
| 19. | [ru/space/afterHellip](../src/rules/ru/space/afterHellip.js) | Пробел после ..., !.. и ?.. | 210 | | ✓ | | ||
| 20. | [common/space/delLeadingBlanks](../src/rules/common/space/delLeadingBlanks.js) | Удаление пробелов в начале строки | 210 | | | | ||
| 21. | [ru/dash/main](../src/rules/ru/dash/main.js) | Замена дефиса на тире | 305 | | ✓ | | ||
| 22. | [ru/dash/taki](../src/rules/ru/dash/taki.js) | Дефис между «верно-таки» и т. д. | 310 | | ✓ | | ||
| 23. | [ru/dash/surname](../src/rules/ru/dash/surname.js) | Сокращения с помощью тире | 310 | | ✓ | | ||
| 24. | [ru/dash/month](../src/rules/ru/dash/month.js) | Тире между месяцами | 310 | | ✓ | | ||
| 25. | [ru/dash/izza](../src/rules/ru/dash/izza.js) | Дефис между «из-за» | 310 | | ✓ | | ||
| 26. | [ru/dash/koe](../src/rules/ru/dash/koe.js) | Дефис после «кое» и «кой» | 310 | | ✓ | | ||
| 27. | [ru/dash/years](../src/rules/ru/dash/years.js) | Замена дефиса на тире в годах | 310 | | ✓ | | ||
| 28. | [ru/dash/kade](../src/rules/ru/dash/kade.js) | Дефис перед «ка», «де», «кась» | 310 | | ✓ | | ||
| 29. | [ru/dash/izpod](../src/rules/ru/dash/izpod.js) | Дефис между «из-под» | 310 | | ✓ | | ||
| 30. | [ru/dash/directSpeech](../src/rules/ru/dash/directSpeech.js) | Тире в прямой речи | 310 | | ✓ | | ||
| 31. | [ru/dash/weekday](../src/rules/ru/dash/weekday.js) | Тире между днями недели | 310 | | ✓ | | ||
| 32. | [ru/dash/decade](../src/rules/ru/dash/decade.js) | Тире в десятилетиях, 80—90-е гг. | 310 | | ✓ | | ||
| 33. | [ru/dash/daysMonth](../src/rules/ru/dash/daysMonth.js) | Тире между днями одного месяца | 310 | | ✓ | | ||
| 34. | [ru/dash/to](../src/rules/ru/dash/to.js) | Дефис перед «то», «либо», «нибудь» | 310 | | ✓ | | ||
| 35. | [ru/dash/time](../src/rules/ru/dash/time.js) | Тире в интервалах времени | 310 | | ✓ | | ||
| 36. | [ru/dash/centuries](../src/rules/ru/dash/centuries.js) | Замена дефиса на тире в веках | 310 | | ✓ | | ||
| 37. | [ru/punctuation/apostrophe](../src/rules/ru/punctuation/apostrophe.js) | Расстановка правильного апострофа | 405 | | ✓ | | ||
| 38. | [en/punctuation/quote](../src/rules/en/punctuation/quote.js) | Расстановка кавычек | 410 | | ✓ | | ||
| 39. | [ru/punctuation/quote](../src/rules/ru/punctuation/quote.js) | Расстановка кавычек | 410 | | ✓ | | ||
| 40. | [ru/punctuation/hellip](../src/rules/ru/punctuation/hellip.js) | Три точки на многоточие, ?... → ?.. и пр. | 410 | | ✓ | | ||
| 41. | [ru/punctuation/exclamation](../src/rules/ru/punctuation/exclamation.js) | !! → ! | 410 | | ✓ | | ||
| 42. | [ru/punctuation/ano](../src/rules/ru/punctuation/ano.js) | Расстановка запятых перед «а» и «но» | 410 | | ✓ | | ||
| 43. | [common/punctuation/delDoublePunctuation](../src/rules/common/punctuation/delDoublePunctuation.js) | Удаление двойной пунктуации | 410 | | ✓ | | ||
| 44. | [ru/punctuation/exclamationQuestion](../src/rules/ru/punctuation/exclamationQuestion.js) | !? → ?! | 415 | | ✓ | | ||
| 45. | [common/nbsp/dpi](../src/rules/common/nbsp/dpi.js) | Нераз. пробел перед lpi и dpi | 510 | | ✓ | | ||
| 46. | [common/nbsp/beforeShortLastWord](../src/rules/common/nbsp/beforeShortLastWord.js) | Нераз. пробел перед последним коротким словом в предложении | 510 | | ✓ | | ||
| 47. | [common/nbsp/afterShortWord](../src/rules/common/nbsp/afterShortWord.js) | Нераз. пробел после короткого слова | 510 | | ✓ | | ||
| 48. | [common/nbsp/afterParagraph](../src/rules/common/nbsp/afterParagraph.js) | Нераз. пробел после § | 510 | | ✓ | | ||
| 49. | [common/nbsp/afterNumber](../src/rules/common/nbsp/afterNumber.js) | Нераз. пробел между числом и словом | 510 | | | | ||
| 50. | [ru/nbsp/year](../src/rules/ru/nbsp/year.js) | Нераз. пробел после XXXX г. (2012 г.) | 510 | | ✓ | | ||
| 51. | [ru/nbsp/see](../src/rules/ru/nbsp/see.js) | Нераз. пробел после сокращений «см.» и «им.» | 510 | | ✓ | | ||
| 52. | [ru/nbsp/ps](../src/rules/ru/nbsp/ps.js) | Нераз. пробел в P. S. и P. P. S. | 510 | | ✓ | | ||
| 53. | [ru/nbsp/page](../src/rules/ru/nbsp/page.js) | Нераз. пробел после «стр.», «гл.», «рис.», «илл.» | 510 | | ✓ | | ||
| 54. | [ru/nbsp/ooo](../src/rules/ru/nbsp/ooo.js) | Нераз. пробел после OOO, ОАО, ЗАО, НИИ и ПБОЮЛ | 510 | | ✓ | | ||
| 55. | [ru/nbsp/dayMonth](../src/rules/ru/nbsp/dayMonth.js) | Нераз. пробел между числом и месяцем | 510 | | ✓ | | ||
| 56. | [ru/nbsp/centuries](../src/rules/ru/nbsp/centuries.js) | Удаление пробелов и лишних точек в «вв.» | 510 | | ✓ | | ||
| 57. | [ru/nbsp/afterNumberSign](../src/rules/ru/nbsp/afterNumberSign.js) | Нераз. пробел после № | 510 | | ✓ | | ||
| 58. | [ru/nbsp/abbr](../src/rules/ru/nbsp/abbr.js) | Нераз. пробел в сокращениях, например, в “т. д.” | 510 | | ✓ | | ||
| 59. | [ru/nbsp/addr](../src/rules/ru/nbsp/addr.js) | Расстановка неразрывного пробела после «г.», «обл.», «ул.», «пр.», «кв.» и др. | 510 | | ✓ | | ||
| 60. | [ru/nbsp/beforeParticle](../src/rules/ru/nbsp/beforeParticle.js) | Нераз. пробел перед «ли», «ль», «же», «бы», «б» | 515 | | ✓ | | ||
| 61. | [ru/nbsp/m](../src/rules/ru/nbsp/m.js) | м2 → м², м3 → м³ и нераз. пробел | 515 | | ✓ | | ||
| 62. | [ru/nbsp/years](../src/rules/ru/nbsp/years.js) | г.г. → гг. и нераз. пробел | 515 | | ✓ | | ||
| 63. | [common/number/times](../src/rules/common/number/times.js) | x → × (10 x 5 → 10×5) | 610 | | ✓ | | ||
| 64. | [ru/number/ordinals](../src/rules/ru/number/ordinals.js) | N-ый, -ой, -ая, -ое, -ые, -ым, -ом, -ых → N-й, -я, -е, -м, -х (25-й) | 610 | | ✓ | | ||
| 65. | [common/number/fraction](../src/rules/common/number/fraction.js) | 1/2 → ½, 1/4 → ¼, 3/3 → ¾ | 610 | | ✓ | | ||
| 66. | [common/number/mathSigns](../src/rules/common/number/mathSigns.js) | != → ≠, <= → ≤, >= → ≥, ~= → ≅, +- → ± | 610 | | ✓ | | ||
| 67. | [ru/money/euro](../src/rules/ru/money/euro.js) | €100 → 100 € | 710 | | ✓ | | ||
| 68. | [ru/money/dollar](../src/rules/ru/money/dollar.js) | $100 → 100 $ | 710 | | ✓ | | ||
| 69. | [ru/money/ruble](../src/rules/ru/money/ruble.js) | 1 руб. → 1 ₽ | 710 | | | | ||
| 70. | [ru/date/fromISO](../src/rules/ru/date/fromISO.js) | Преобразование дат YYYY-MM-DD к виду DD.MM.YYYY | 810 | | ✓ | | ||
| 71. | [ru/date/weekday](../src/rules/ru/date/weekday.js) | 2 Мая, Понедельник → 2 мая, понедельник | 810 | | ✓ | | ||
| 72. | [common/other/repeatWord](../src/rules/common/other/repeatWord.js) | Удаление повтора слова | 910 | | | | ||
| 73. | [ru/other/accent](../src/rules/ru/other/accent.js) | Замена заглавной буквы на строчную с добавлением ударения | 910 | | | | ||
| 74. | [ru/optalign/quote](../src/rules/ru/optalign/quote.js) | для открывающей кавычки | 1010 | | | | ||
| 75. | [ru/optalign/bracket](../src/rules/ru/optalign/bracket.js) | для открывающей скобки | 1010 | | | | ||
| 76. | [ru/optalign/comma](../src/rules/ru/optalign/comma.js) | для запятой | 1010 | | | | ||
| 77. | [common/html/url](../src/rules/common/html/url.js) | Расстановка ссылок | 1110 | | | | ||
| 78. | [common/html/e-mail](../src/rules/common/html/e-mail.js) | Расстановка ссылок для эл. почты | 1110 | | | | ||
| 79. | [common/nbsp/nowrap](../src/rules/common/nbsp/nowrap.js) | Заменять нераз. пробел на обычный пробел в тегах nowrap и nobr | 510 | end | ✓ | | ||
| 80. | [common/html/pbr](../src/rules/common/html/pbr.js) | Расстановка тегов p и br | 1110 | end | | | ||
| 81. | [common/html/nbr](../src/rules/common/html/nbr.js) | Замена перевода строки на <br/> | 1115 | end | | | ||
| 82. | [common/html/stripTags](../src/rules/common/html/stripTags.js) | Удаление HTML-тегов | 1209 | end | | | ||
| 83. | [common/html/escape](../src/rules/common/html/escape.js) | Экранирование HTML | 1210 | end | | |
@@ -5,75 +5,84 @@ ## Rules of typograf | ||
|--:|--------|-------|------------------------------:|:-----:|:--:| | ||
| 1. | [common/other/delBOM](../src/rules/common/other/delBOM.js) | Delete character BOM (Byte Order Mark) | 0 | start | ✓ | | ||
| 2. | [common/html/nbr](../src/rules/common/html/nbr.js) | Replacement line break on <br/> | 110 | start | | | ||
| 3. | [common/sym/copy](../src/rules/common/sym/copy.js) | (c) → ©, (tm) → ™, (r) → ® | 10 | | ✓ | | ||
| 4. | [ru/punctuation/hellip](../src/rules/ru/punctuation/hellip.js) | Three points on ellipsis | 20 | | ✓ | | ||
| 5. | [common/nbsp/replaceNbsp](../src/rules/common/nbsp/replaceNbsp.js) | Replacing non-breaking space in the ordinary | 0 | utf | ✓ | | ||
| 6. | [common/nbsp/nowrap](../src/rules/common/nbsp/nowrap.js) | Replace non-breaking space to normal space in tags nowrap and nobr | 100 | start | ✓ | | ||
| 7. | [ru/dash/to](../src/rules/ru/dash/to.js) | Hyphen before “то, либо, нибудь” | 30 | | ✓ | | ||
| 8. | [ru/dash/kade](../src/rules/ru/dash/kade.js) | Hyphen before “ка, де, кась” | 31 | | ✓ | | ||
| 9. | [ru/dash/izza](../src/rules/ru/dash/izza.js) | Hyphen between “из-за” | 33 | | ✓ | | ||
| 10. | [ru/dash/izpod](../src/rules/ru/dash/izpod.js) | Hyphen between “из-под” | 35 | | ✓ | | ||
| 11. | [ru/dash/koe](../src/rules/ru/dash/koe.js) | Hyphen after “кое” and “кой” | 38 | | ✓ | | ||
| 12. | [ru/dash/taki](../src/rules/ru/dash/taki.js) | Hyphen between “верно-таки” and etc. | 39 | | ✓ | | ||
| 13. | [common/space/delLeadingBlanks](../src/rules/common/space/delLeadingBlanks.js) | Remove spaces at start of line | 504 | | | | ||
| 14. | [common/space/delTrailingBlanks](../src/rules/common/space/delTrailingBlanks.js) | Remove spaces at end of line | 505 | | ✓ | | ||
| 15. | [common/space/replaceTab](../src/rules/common/space/replaceTab.js) | Replacement of tab to 4 spaces | 510 | | ✓ | | ||
| 16. | [common/space/trimLeft](../src/rules/common/space/trimLeft.js) | Remove spaces and line breaks in beginning of text | 530 | | ✓ | | ||
| 17. | [common/space/trimRight](../src/rules/common/space/trimRight.js) | Remove spaces and line breaks at end of text | 535 | | ✓ | | ||
| 18. | [common/space/delRepeatSpace](../src/rules/common/space/delRepeatSpace.js) | Removing duplicate spaces between characters | 540 | | ✓ | | ||
| 19. | [common/space/delRepeatN](../src/rules/common/space/delRepeatN.js) | Remove duplicate line breaks (no more than two) | 545 | | ✓ | | ||
| 20. | [common/space/delBeforePunctuation](../src/rules/common/space/delBeforePunctuation.js) | Remove spaces before punctuation | 550 | | ✓ | | ||
| 21. | [common/space/squareBracket](../src/rules/common/space/squareBracket.js) | Remove spaces inside square brackets | 560 | | ✓ | | ||
| 22. | [common/space/afterPunctuation](../src/rules/common/space/afterPunctuation.js) | space after punctuation | 560 | | ✓ | | ||
| 23. | [ru/other/accent](../src/rules/ru/other/accent.js) | Replacing capital letter and adding accents | 560 | | | | ||
| 24. | [common/space/bracket](../src/rules/common/space/bracket.js) | Remove spaces inside brackets | 560 | | ✓ | | ||
| 25. | [common/space/beforeBracket](../src/rules/common/space/beforeBracket.js) | Space before opening bracket | 560 | | ✓ | | ||
| 26. | [ru/nbsp/abbr](../src/rules/ru/nbsp/abbr.js) | Non-breaking space in abbreviations, e.g. “т. д.” | 565 | | ✓ | | ||
| 27. | [ru/nbsp/ps](../src/rules/ru/nbsp/ps.js) | Non-breaking space in P. S. and P. P. S. | 565 | | ✓ | | ||
| 28. | [common/punctuation/delDoublePunctuation](../src/rules/common/punctuation/delDoublePunctuation.js) | Removing double punctuation | 580 | | ✓ | | ||
| 29. | [common/nbsp/afterShortWord](../src/rules/common/nbsp/afterShortWord.js) | Non-breaking space after short word | 590 | | ✓ | | ||
| 30. | [ru/dash/weekday](../src/rules/ru/dash/weekday.js) | Dash between the days of the week | 600 | | ✓ | | ||
| 31. | [common/space/delBeforePercent](../src/rules/common/space/delBeforePercent.js) | Remove space before %, ‰ and ‱ | 600 | | ✓ | | ||
| 32. | [ru/space/year](../src/rules/ru/space/year.js) | Space between number and word “год” | 600 | | ✓ | | ||
| 33. | [ru/nbsp/beforeParticle](../src/rules/ru/nbsp/beforeParticle.js) | Non-breaking space before “ли, ль, же, бы, б” | 600 | | ✓ | | ||
| 34. | [ru/nbsp/afterNumberSign](../src/rules/ru/nbsp/afterNumberSign.js) | Non-breaking space after № | 610 | | ✓ | | ||
| 35. | [ru/nbsp/page](../src/rules/ru/nbsp/page.js) | Non-breaking space before “стр., гл., рис., илл.” | 610 | | ✓ | | ||
| 36. | [ru/dash/month](../src/rules/ru/dash/month.js) | Dash between months | 610 | | ✓ | | ||
| 37. | [common/nbsp/afterPara](../src/rules/common/nbsp/afterPara.js) | Non-breaking space after § | 610 | | ✓ | | ||
| 38. | [common/nbsp/afterNumber](../src/rules/common/nbsp/afterNumber.js) | Non-breaking space between number and word | 615 | | ✓ | | ||
| 39. | [common/nbsp/beforeShortLastWord](../src/rules/common/nbsp/beforeShortLastWord.js) | Non-breaking space before last short word in sentence | 620 | | ✓ | | ||
| 40. | [ru/dash/main](../src/rules/ru/dash/main.js) | Replacement hyphen with dash | 620 | | ✓ | | ||
| 41. | [ru/punctuation/apostrophe](../src/rules/ru/punctuation/apostrophe.js) | Placement of correct apostrophe | 695 | | ✓ | | ||
| 42. | [ru/punctuation/quot](../src/rules/ru/punctuation/quot.js) | Placement of quotation marks | 700 | | ✓ | | ||
| 43. | [en/punctuation/quot](../src/rules/en/punctuation/quot.js) | Placement of quotation marks | 700 | | ✓ | | ||
| 44. | [ru/optalign/quot](../src/rules/ru/optalign/quot.js) | for opening quotation marks | 1000 | | | | ||
| 45. | [ru/optalign/bracket](../src/rules/ru/optalign/bracket.js) | for opening bracket | 1001 | | | | ||
| 46. | [ru/optalign/comma](../src/rules/ru/optalign/comma.js) | for comma | 1002 | | | | ||
| 47. | [common/number/mathSigns](../src/rules/common/number/mathSigns.js) | != → ≠, <= → ≤, >= → ≥, ~= → ≅, +- → ± | 1010 | | ✓ | | ||
| 48. | [common/sym/cf](../src/rules/common/sym/cf.js) | Adding ° to C and F | 1020 | | ✓ | | ||
| 49. | [ru/nbsp/m](../src/rules/ru/nbsp/m.js) | m2 → м², m3 → м³ and non-breaking space | 1030 | | ✓ | | ||
| 50. | [common/number/times](../src/rules/common/number/times.js) | x → × (10 x 5 → 10×5) | 1050 | | ✓ | | ||
| 51. | [ru/nbsp/xxxx](../src/rules/ru/nbsp/xxxx.js) | Non-breaking space before XXXX г. (2012 г.) | 1060 | | ✓ | | ||
| 52. | [ru/nbsp/yy](../src/rules/ru/nbsp/yy.js) | г.г. → гг. and non-breaking space | 1080 | | ✓ | | ||
| 53. | [ru/nbsp/cc](../src/rules/ru/nbsp/cc.js) | Remove spaces and extra points in centuries | 1090 | | ✓ | | ||
| 54. | [ru/nbsp/ooo](../src/rules/ru/nbsp/ooo.js) | Non-breaking space after “OOO, ОАО, ЗАО, НИИ, ПБОЮЛ” | 1100 | | ✓ | | ||
| 55. | [ru/nbsp/dayMonth](../src/rules/ru/nbsp/dayMonth.js) | Non-breaking space between number and month | 1105 | | ✓ | | ||
| 56. | [ru/punctuation/ano](../src/rules/ru/punctuation/ano.js) | Placement of commas before “а” and “но” | 1110 | | ✓ | | ||
| 57. | [ru/nbsp/addr](../src/rules/ru/nbsp/addr.js) | Placement of non-breaking space after “г.”, “обл.”, “ул.”, “пр.”, “кв.” et al. | 1115 | | ✓ | | ||
| 58. | [common/number/fraction](../src/rules/common/number/fraction.js) | 1/2 → ½, 1/4 → ¼, 3/3 → ¾ | 1120 | | ✓ | | ||
| 59. | [common/sym/arrow](../src/rules/common/sym/arrow.js) | -> → →, <- → ← | 1130 | | ✓ | | ||
| 60. | [ru/money/dollar](../src/rules/ru/money/dollar.js) | $100 → 100 $ | 1140 | | ✓ | | ||
| 61. | [common/punctuation/exclamation](../src/rules/common/punctuation/exclamation.js) | !! → ! | 1140 | | ✓ | | ||
| 62. | [ru/money/euro](../src/rules/ru/money/euro.js) | €100 → 100 € | 1140 | | ✓ | | ||
| 63. | [ru/money/ruble](../src/rules/ru/money/ruble.js) | 1 руб. → 1 ₽ | 1145 | | | | ||
| 64. | [common/punctuation/exclamationQuestion](../src/rules/common/punctuation/exclamationQuestion.js) | !? → ?! | 1150 | | ✓ | | ||
| 65. | [common/nbsp/dpi](../src/rules/common/nbsp/dpi.js) | Non-breaking space before lpi, dpi | 1150 | | ✓ | | ||
| 66. | [common/other/repeatWord](../src/rules/common/other/repeatWord.js) | Removing repeat words | 1200 | | | | ||
| 67. | [ru/number/ordinals](../src/rules/ru/number/ordinals.js) | N-ый, -ой, -ая, -ое, -ые, -ым, -ом, -ых → N-й, -я, -е, -м, -х (25-й) | 1300 | | ✓ | | ||
| 68. | [ru/date/main](../src/rules/ru/date/main.js) | Converting dates YYYY-MM-DD type DD.MM.YYYY | 1300 | | ✓ | | ||
| 69. | [ru/date/weekday](../src/rules/ru/date/weekday.js) | 2 Мая, Понедельник → 2 мая, понедельник | 1310 | | ✓ | | ||
| 70. | [common/html/mail](../src/rules/common/html/mail.js) | Placement of links for e-mail | 2000 | | | | ||
| 71. | [common/html/url](../src/rules/common/html/url.js) | Placement of links | 2010 | | | | ||
| 72. | [common/html/pbr](../src/rules/common/html/pbr.js) | Placement of p and br tags | 90 | end | | | ||
| 73. | [common/html/stripTags](../src/rules/common/html/stripTags.js) | Removing HTML-tags | 100 | end | | | ||
| 74. | [common/html/escape](../src/rules/common/html/escape.js) | Escaping HTML | 110 | end | | | ||
| 1. | [common/html/e-mail](../src/rules/common/html/e-mail.js) | Placement of links for e-mail | 1110 | | | | ||
| 2. | [common/html/escape](../src/rules/common/html/escape.js) | Escaping HTML | 1210 | end | | | ||
| 3. | [common/html/nbr](../src/rules/common/html/nbr.js) | Replacement line break on <br/> | 1115 | end | | | ||
| 4. | [common/html/pbr](../src/rules/common/html/pbr.js) | Placement of p and br tags | 1110 | end | | | ||
| 5. | [common/html/stripTags](../src/rules/common/html/stripTags.js) | Removing HTML-tags | 1209 | end | | | ||
| 6. | [common/html/url](../src/rules/common/html/url.js) | Placement of links | 1110 | | | | ||
| 7. | [common/nbsp/afterNumber](../src/rules/common/nbsp/afterNumber.js) | Non-breaking space between number and word | 510 | | | | ||
| 8. | [common/nbsp/afterParagraph](../src/rules/common/nbsp/afterParagraph.js) | Non-breaking space after § | 510 | | ✓ | | ||
| 9. | [common/nbsp/afterShortWord](../src/rules/common/nbsp/afterShortWord.js) | Non-breaking space after short word | 510 | | ✓ | | ||
| 10. | [common/nbsp/beforeShortLastWord](../src/rules/common/nbsp/beforeShortLastWord.js) | Non-breaking space before last short word in sentence | 510 | | ✓ | | ||
| 11. | [common/nbsp/dpi](../src/rules/common/nbsp/dpi.js) | Non-breaking space before lpi and dpi | 510 | | ✓ | | ||
| 12. | [common/nbsp/nowrap](../src/rules/common/nbsp/nowrap.js) | Replace non-breaking space to normal space in tags nowrap and nobr | 510 | end | ✓ | | ||
| 13. | [common/nbsp/replaceNbsp](../src/rules/common/nbsp/replaceNbsp.js) | Replacing non-breaking space in the ordinary | 510 | utf | ✓ | | ||
| 14. | [common/number/fraction](../src/rules/common/number/fraction.js) | 1/2 → ½, 1/4 → ¼, 3/3 → ¾ | 610 | | ✓ | | ||
| 15. | [common/number/mathSigns](../src/rules/common/number/mathSigns.js) | != → ≠, <= → ≤, >= → ≥, ~= → ≅, +- → ± | 610 | | ✓ | | ||
| 16. | [common/number/times](../src/rules/common/number/times.js) | x → × (10 x 5 → 10×5) | 610 | | ✓ | | ||
| 17. | [common/other/delBOM](../src/rules/common/other/delBOM.js) | Delete character BOM (Byte Order Mark) | -1 | start | ✓ | | ||
| 18. | [common/other/repeatWord](../src/rules/common/other/repeatWord.js) | Removing repeat words | 910 | | | | ||
| 19. | [common/punctuation/delDoublePunctuation](../src/rules/common/punctuation/delDoublePunctuation.js) | Removing double punctuation | 410 | | ✓ | | ||
| 20. | [common/space/afterPunctuation](../src/rules/common/space/afterPunctuation.js) | space after punctuation | 210 | | ✓ | | ||
| 21. | [common/space/beforeBracket](../src/rules/common/space/beforeBracket.js) | Space before opening bracket | 210 | | ✓ | | ||
| 22. | [common/space/bracket](../src/rules/common/space/bracket.js) | Remove extra spaces after opening and before closing bracket | 210 | | ✓ | | ||
| 23. | [common/space/delBeforePercent](../src/rules/common/space/delBeforePercent.js) | Remove space before %, ‰ and ‱ | 210 | | ✓ | | ||
| 24. | [common/space/delBeforePunctuation](../src/rules/common/space/delBeforePunctuation.js) | Remove spaces before punctuation | 210 | | ✓ | | ||
| 25. | [common/space/delLeadingBlanks](../src/rules/common/space/delLeadingBlanks.js) | Remove spaces at start of line | 210 | | | | ||
| 26. | [common/space/delRepeatN](../src/rules/common/space/delRepeatN.js) | Remove duplicate line breaks (three or more) | 209 | | ✓ | | ||
| 27. | [common/space/delRepeatSpace](../src/rules/common/space/delRepeatSpace.js) | Removing duplicate spaces between characters | 209 | | ✓ | | ||
| 28. | [common/space/delTrailingBlanks](../src/rules/common/space/delTrailingBlanks.js) | Remove spaces at end of line | 207 | | ✓ | | ||
| 29. | [common/space/replaceTab](../src/rules/common/space/replaceTab.js) | Replacement of tab to 4 spaces | 205 | | ✓ | | ||
| 30. | [common/space/squareBracket](../src/rules/common/space/squareBracket.js) | Remove extra spaces after opening and before closing square bracket | 210 | | ✓ | | ||
| 31. | [common/space/trimLeft](../src/rules/common/space/trimLeft.js) | Remove spaces and line breaks in beginning of text | 206 | | ✓ | | ||
| 32. | [common/space/trimRight](../src/rules/common/space/trimRight.js) | Remove spaces and line breaks at end of text | 207 | | ✓ | | ||
| 33. | [common/symbols/arrow](../src/rules/common/symbols/arrow.js) | -> → →, <- → ← | 110 | | ✓ | | ||
| 34. | [common/symbols/cf](../src/rules/common/symbols/cf.js) | Adding ° to C and F | 110 | | ✓ | | ||
| 35. | [common/symbols/copy](../src/rules/common/symbols/copy.js) | (c) → ©, (tm) → ™, (r) → ® | 110 | | ✓ | | ||
| 36. | [en/punctuation/quote](../src/rules/en/punctuation/quote.js) | Placement of quotation marks | 410 | | ✓ | | ||
| 37. | [ru/dash/centuries](../src/rules/ru/dash/centuries.js) | Hyphen to dash in centuries | 310 | | ✓ | | ||
| 38. | [ru/dash/daysMonth](../src/rules/ru/dash/daysMonth.js) | Dash between days of one month | 310 | | ✓ | | ||
| 39. | [ru/dash/decade](../src/rules/ru/dash/decade.js) | Dash in decade | 310 | | ✓ | | ||
| 40. | [ru/dash/directSpeech](../src/rules/ru/dash/directSpeech.js) | Dash in direct speech | 310 | | ✓ | | ||
| 41. | [ru/dash/izpod](../src/rules/ru/dash/izpod.js) | Hyphen between “из-под” | 310 | | ✓ | | ||
| 42. | [ru/dash/izza](../src/rules/ru/dash/izza.js) | Hyphen between “из-за” | 310 | | ✓ | | ||
| 43. | [ru/dash/kade](../src/rules/ru/dash/kade.js) | Hyphen before “ка, де, кась” | 310 | | ✓ | | ||
| 44. | [ru/dash/koe](../src/rules/ru/dash/koe.js) | Hyphen after “кое” and “кой” | 310 | | ✓ | | ||
| 45. | [ru/dash/main](../src/rules/ru/dash/main.js) | Replacement hyphen with dash | 305 | | ✓ | | ||
| 46. | [ru/dash/month](../src/rules/ru/dash/month.js) | Dash between months | 310 | | ✓ | | ||
| 47. | [ru/dash/surname](../src/rules/ru/dash/surname.js) | Acronyms with a dash | 310 | | ✓ | | ||
| 48. | [ru/dash/taki](../src/rules/ru/dash/taki.js) | Hyphen between “верно-таки” and etc. | 310 | | ✓ | | ||
| 49. | [ru/dash/time](../src/rules/ru/dash/time.js) | Dash in time intervals | 310 | | ✓ | | ||
| 50. | [ru/dash/to](../src/rules/ru/dash/to.js) | Hyphen before “то”, “либо”, “нибудь” | 310 | | ✓ | | ||
| 51. | [ru/dash/weekday](../src/rules/ru/dash/weekday.js) | Dash between the days of the week | 310 | | ✓ | | ||
| 52. | [ru/dash/years](../src/rules/ru/dash/years.js) | Hyphen to dash in years | 310 | | ✓ | | ||
| 53. | [ru/date/fromISO](../src/rules/ru/date/fromISO.js) | Converting dates YYYY-MM-DD type DD.MM.YYYY | 810 | | ✓ | | ||
| 54. | [ru/date/weekday](../src/rules/ru/date/weekday.js) | 2 Мая, Понедельник → 2 мая, понедельник | 810 | | ✓ | | ||
| 55. | [ru/money/dollar](../src/rules/ru/money/dollar.js) | $100 → 100 $ | 710 | | ✓ | | ||
| 56. | [ru/money/euro](../src/rules/ru/money/euro.js) | €100 → 100 € | 710 | | ✓ | | ||
| 57. | [ru/money/ruble](../src/rules/ru/money/ruble.js) | 1 руб. → 1 ₽ | 710 | | | | ||
| 58. | [ru/nbsp/abbr](../src/rules/ru/nbsp/abbr.js) | Non-breaking space in abbreviations, e.g. “т. д.” | 510 | | ✓ | | ||
| 59. | [ru/nbsp/addr](../src/rules/ru/nbsp/addr.js) | Placement of non-breaking space after “г.”, “обл.”, “ул.”, “пр.”, “кв.” et al. | 510 | | ✓ | | ||
| 60. | [ru/nbsp/afterNumberSign](../src/rules/ru/nbsp/afterNumberSign.js) | Non-breaking space after № | 510 | | ✓ | | ||
| 61. | [ru/nbsp/beforeParticle](../src/rules/ru/nbsp/beforeParticle.js) | Non-breaking space before “ли”, “ль”, “же”, “бы”, “б” | 515 | | ✓ | | ||
| 62. | [ru/nbsp/centuries](../src/rules/ru/nbsp/centuries.js) | Remove spaces and extra points in “вв.” | 510 | | ✓ | | ||
| 63. | [ru/nbsp/dayMonth](../src/rules/ru/nbsp/dayMonth.js) | Non-breaking space between number and month | 510 | | ✓ | | ||
| 64. | [ru/nbsp/m](../src/rules/ru/nbsp/m.js) | m2 → м², m3 → м³ and non-breaking space | 515 | | ✓ | | ||
| 65. | [ru/nbsp/ooo](../src/rules/ru/nbsp/ooo.js) | Non-breaking space after “OOO, ОАО, ЗАО, НИИ, ПБОЮЛ” | 510 | | ✓ | | ||
| 66. | [ru/nbsp/page](../src/rules/ru/nbsp/page.js) | Non-breaking space after “стр.”, “гл.”, “рис.”, “илл.” | 510 | | ✓ | | ||
| 67. | [ru/nbsp/ps](../src/rules/ru/nbsp/ps.js) | Non-breaking space in P. S. and P. P. S. | 510 | | ✓ | | ||
| 68. | [ru/nbsp/see](../src/rules/ru/nbsp/see.js) | Non-breaking space after abbreviation «см.» and «им.» | 510 | | ✓ | | ||
| 69. | [ru/nbsp/year](../src/rules/ru/nbsp/year.js) | Non-breaking space before XXXX г. (2012 г.) | 510 | | ✓ | | ||
| 70. | [ru/nbsp/years](../src/rules/ru/nbsp/years.js) | г.г. → гг. and non-breaking space | 515 | | ✓ | | ||
| 71. | [ru/number/ordinals](../src/rules/ru/number/ordinals.js) | N-ый, -ой, -ая, -ое, -ые, -ым, -ом, -ых → N-й, -я, -е, -м, -х (25-й) | 610 | | ✓ | | ||
| 72. | [ru/optalign/bracket](../src/rules/ru/optalign/bracket.js) | for opening bracket | 1010 | | | | ||
| 73. | [ru/optalign/comma](../src/rules/ru/optalign/comma.js) | for comma | 1010 | | | | ||
| 74. | [ru/optalign/quote](../src/rules/ru/optalign/quote.js) | for opening quotation marks | 1010 | | | | ||
| 75. | [ru/other/accent](../src/rules/ru/other/accent.js) | Replacement capital letters to lowercase with addition of accent | 910 | | | | ||
| 76. | [ru/punctuation/ano](../src/rules/ru/punctuation/ano.js) | Placement of commas before “а” and “но” | 410 | | ✓ | | ||
| 77. | [ru/punctuation/apostrophe](../src/rules/ru/punctuation/apostrophe.js) | Placement of correct apostrophe | 405 | | ✓ | | ||
| 78. | [ru/punctuation/exclamation](../src/rules/ru/punctuation/exclamation.js) | !! → ! | 410 | | ✓ | | ||
| 79. | [ru/punctuation/exclamationQuestion](../src/rules/ru/punctuation/exclamationQuestion.js) | !? → ?! | 415 | | ✓ | | ||
| 80. | [ru/punctuation/hellip](../src/rules/ru/punctuation/hellip.js) | Three points on ellipsis | 410 | | ✓ | | ||
| 81. | [ru/punctuation/quote](../src/rules/ru/punctuation/quote.js) | Placement of quotation marks | 410 | | ✓ | | ||
| 82. | [ru/space/afterHellip](../src/rules/ru/space/afterHellip.js) | Space after ..., !.. and ?.. | 210 | | ✓ | | ||
| 83. | [ru/space/year](../src/rules/ru/space/year.js) | Space between number and word “год” | 210 | | ✓ | |
@@ -5,75 +5,84 @@ ## Правила типографа | ||
|--:|-------|----------|----------------------------:|:-------:|:----:| | ||
| 1. | [common/other/delBOM](../src/rules/common/other/delBOM.js) | Удаление символа BOM (Byte Order Mark) | 0 | start | ✓ | | ||
| 2. | [common/html/nbr](../src/rules/common/html/nbr.js) | Замена перевода строки на <br/> | 110 | start | | | ||
| 3. | [common/sym/copy](../src/rules/common/sym/copy.js) | (c) → ©, (tm) → ™, (r) → ® | 10 | | ✓ | | ||
| 4. | [ru/punctuation/hellip](../src/rules/ru/punctuation/hellip.js) | Три точки на многоточие, ?... → ?.. и пр. | 20 | | ✓ | | ||
| 5. | [common/nbsp/replaceNbsp](../src/rules/common/nbsp/replaceNbsp.js) | Замена неразрывного пробела на обычный | 0 | utf | ✓ | | ||
| 6. | [common/nbsp/nowrap](../src/rules/common/nbsp/nowrap.js) | Заменять нераз. пробел на обычный пробел в тегах nowrap и nobr | 100 | start | ✓ | | ||
| 7. | [ru/dash/to](../src/rules/ru/dash/to.js) | Дефис перед то, либо, нибудь | 30 | | ✓ | | ||
| 8. | [ru/dash/kade](../src/rules/ru/dash/kade.js) | Дефис перед ка, де, кась | 31 | | ✓ | | ||
| 9. | [ru/dash/izza](../src/rules/ru/dash/izza.js) | Дефис между из-за | 33 | | ✓ | | ||
| 10. | [ru/dash/izpod](../src/rules/ru/dash/izpod.js) | Дефис между из-под | 35 | | ✓ | | ||
| 11. | [ru/dash/koe](../src/rules/ru/dash/koe.js) | Дефис после кое и кой | 38 | | ✓ | | ||
| 12. | [ru/dash/taki](../src/rules/ru/dash/taki.js) | Дефис между верно-таки и т.д. | 39 | | ✓ | | ||
| 13. | [common/space/delLeadingBlanks](../src/rules/common/space/delLeadingBlanks.js) | Удаление пробелов в начале строки | 504 | | | | ||
| 14. | [common/space/delTrailingBlanks](../src/rules/common/space/delTrailingBlanks.js) | Удаление пробелов в конце строки | 505 | | ✓ | | ||
| 15. | [common/space/replaceTab](../src/rules/common/space/replaceTab.js) | Замена таба на 4 пробела | 510 | | ✓ | | ||
| 16. | [common/space/trimLeft](../src/rules/common/space/trimLeft.js) | Удаление пробелов и переносов строк в начале текста | 530 | | ✓ | | ||
| 17. | [common/space/trimRight](../src/rules/common/space/trimRight.js) | Удаление пробелов и переносов строк в конце текста | 535 | | ✓ | | ||
| 18. | [common/space/delRepeatSpace](../src/rules/common/space/delRepeatSpace.js) | Удаление повторяющихся пробелов между символами | 540 | | ✓ | | ||
| 19. | [common/space/delRepeatN](../src/rules/common/space/delRepeatN.js) | Удаление повторяющихся переносов строки (не более двух) | 545 | | ✓ | | ||
| 20. | [common/space/delBeforePunctuation](../src/rules/common/space/delBeforePunctuation.js) | Удаление пробелов перед знаками пунктуации | 550 | | ✓ | | ||
| 21. | [common/space/squareBracket](../src/rules/common/space/squareBracket.js) | Удаление лишних пробелов внутри квадратных скобок | 560 | | ✓ | | ||
| 22. | [common/space/afterPunctuation](../src/rules/common/space/afterPunctuation.js) | Пробел после знаков пунктуации | 560 | | ✓ | | ||
| 23. | [ru/other/accent](../src/rules/ru/other/accent.js) | Замена заглавной буквы и добавление знака ударения | 560 | | | | ||
| 24. | [common/space/bracket](../src/rules/common/space/bracket.js) | Удаление лишних пробелов внутри скобок | 560 | | ✓ | | ||
| 25. | [common/space/beforeBracket](../src/rules/common/space/beforeBracket.js) | Пробел перед открывающей скобкой | 560 | | ✓ | | ||
| 26. | [ru/nbsp/abbr](../src/rules/ru/nbsp/abbr.js) | Нераз. пробел в сокращениях, например, в т. д. | 565 | | ✓ | | ||
| 27. | [ru/nbsp/ps](../src/rules/ru/nbsp/ps.js) | Нераз. пробел в P. S. и P. P. S. | 565 | | ✓ | | ||
| 28. | [common/punctuation/delDoublePunctuation](../src/rules/common/punctuation/delDoublePunctuation.js) | Удаление двойной пунктуации | 580 | | ✓ | | ||
| 29. | [common/nbsp/afterShortWord](../src/rules/common/nbsp/afterShortWord.js) | Нераз. пробел после короткого слова | 590 | | ✓ | | ||
| 30. | [ru/dash/weekday](../src/rules/ru/dash/weekday.js) | Тире между днями недели | 600 | | ✓ | | ||
| 31. | [common/space/delBeforePercent](../src/rules/common/space/delBeforePercent.js) | Удаление пробела перед %, ‰ и ‱ | 600 | | ✓ | | ||
| 32. | [ru/space/year](../src/rules/ru/space/year.js) | Пробел между числом и словом «год» | 600 | | ✓ | | ||
| 33. | [ru/nbsp/beforeParticle](../src/rules/ru/nbsp/beforeParticle.js) | Нераз. пробел перед ли, ль, же, бы, б | 600 | | ✓ | | ||
| 34. | [ru/nbsp/afterNumberSign](../src/rules/ru/nbsp/afterNumberSign.js) | Нераз. пробел после № | 610 | | ✓ | | ||
| 35. | [ru/nbsp/page](../src/rules/ru/nbsp/page.js) | Нераз. пробел перед стр., гл., рис., илл. | 610 | | ✓ | | ||
| 36. | [ru/dash/month](../src/rules/ru/dash/month.js) | Тире между месяцами | 610 | | ✓ | | ||
| 37. | [common/nbsp/afterPara](../src/rules/common/nbsp/afterPara.js) | Нераз. пробел после § | 610 | | ✓ | | ||
| 38. | [common/nbsp/afterNumber](../src/rules/common/nbsp/afterNumber.js) | Нераз. пробел между числом и словом | 615 | | ✓ | | ||
| 39. | [common/nbsp/beforeShortLastWord](../src/rules/common/nbsp/beforeShortLastWord.js) | Нераз. пробел перед последним коротким словом в предложении | 620 | | ✓ | | ||
| 40. | [ru/dash/main](../src/rules/ru/dash/main.js) | Дефис на тире | 620 | | ✓ | | ||
| 41. | [ru/punctuation/apostrophe](../src/rules/ru/punctuation/apostrophe.js) | Расстановка правильного апострофа | 695 | | ✓ | | ||
| 42. | [ru/punctuation/quot](../src/rules/ru/punctuation/quot.js) | Расстановка кавычек | 700 | | ✓ | | ||
| 43. | [en/punctuation/quot](../src/rules/en/punctuation/quot.js) | Расстановка кавычек | 700 | | ✓ | | ||
| 44. | [ru/optalign/quot](../src/rules/ru/optalign/quot.js) | для открывающей кавычки | 1000 | | | | ||
| 45. | [ru/optalign/bracket](../src/rules/ru/optalign/bracket.js) | для открывающей скобки | 1001 | | | | ||
| 46. | [ru/optalign/comma](../src/rules/ru/optalign/comma.js) | для запятой | 1002 | | | | ||
| 47. | [common/number/mathSigns](../src/rules/common/number/mathSigns.js) | != → ≠, <= → ≤, >= → ≥, ~= → ≅, +- → ± | 1010 | | ✓ | | ||
| 48. | [common/sym/cf](../src/rules/common/sym/cf.js) | Добавление ° к C и F | 1020 | | ✓ | | ||
| 49. | [ru/nbsp/m](../src/rules/ru/nbsp/m.js) | м2 → м², м3 → м³ и нераз. пробел | 1030 | | ✓ | | ||
| 50. | [common/number/times](../src/rules/common/number/times.js) | x → × (10 x 5 → 10×5) | 1050 | | ✓ | | ||
| 51. | [ru/nbsp/xxxx](../src/rules/ru/nbsp/xxxx.js) | Нераз. пробел после XXXX г. (2012 г.) | 1060 | | ✓ | | ||
| 52. | [ru/nbsp/yy](../src/rules/ru/nbsp/yy.js) | г.г. → гг. и нераз. пробел | 1080 | | ✓ | | ||
| 53. | [ru/nbsp/cc](../src/rules/ru/nbsp/cc.js) | Удаление пробелов и лишних точек в вв. | 1090 | | ✓ | | ||
| 54. | [ru/nbsp/ooo](../src/rules/ru/nbsp/ooo.js) | Нераз. пробел после OOO, ОАО, ЗАО, НИИ и ПБОЮЛ | 1100 | | ✓ | | ||
| 55. | [ru/nbsp/dayMonth](../src/rules/ru/nbsp/dayMonth.js) | Нераз. пробел между числом и месяцем | 1105 | | ✓ | | ||
| 56. | [ru/punctuation/ano](../src/rules/ru/punctuation/ano.js) | Расстановка запятых перед а и но | 1110 | | ✓ | | ||
| 57. | [ru/nbsp/addr](../src/rules/ru/nbsp/addr.js) | Расстановка неразрывного пробела после «г.», «обл.», «ул.», «пр.», «кв.» и др. | 1115 | | ✓ | | ||
| 58. | [common/number/fraction](../src/rules/common/number/fraction.js) | 1/2 → ½, 1/4 → ¼, 3/3 → ¾ | 1120 | | ✓ | | ||
| 59. | [common/sym/arrow](../src/rules/common/sym/arrow.js) | -> → →, <- → ← | 1130 | | ✓ | | ||
| 60. | [ru/money/dollar](../src/rules/ru/money/dollar.js) | $100 → 100 $ | 1140 | | ✓ | | ||
| 61. | [common/punctuation/exclamation](../src/rules/common/punctuation/exclamation.js) | !! → ! | 1140 | | ✓ | | ||
| 62. | [ru/money/euro](../src/rules/ru/money/euro.js) | €100 → 100 € | 1140 | | ✓ | | ||
| 63. | [ru/money/ruble](../src/rules/ru/money/ruble.js) | 1 руб. → 1 ₽ | 1145 | | | | ||
| 64. | [common/punctuation/exclamationQuestion](../src/rules/common/punctuation/exclamationQuestion.js) | !? → ?! | 1150 | | ✓ | | ||
| 65. | [common/nbsp/dpi](../src/rules/common/nbsp/dpi.js) | Нераз. пробел перед lpi, dpi | 1150 | | ✓ | | ||
| 66. | [common/other/repeatWord](../src/rules/common/other/repeatWord.js) | Удаление повтора слова | 1200 | | | | ||
| 67. | [ru/number/ordinals](../src/rules/ru/number/ordinals.js) | N-ый, -ой, -ая, -ое, -ые, -ым, -ом, -ых → N-й, -я, -е, -м, -х (25-й) | 1300 | | ✓ | | ||
| 68. | [ru/date/main](../src/rules/ru/date/main.js) | Преобразование дат YYYY-MM-DD к виду DD.MM.YYYY | 1300 | | ✓ | | ||
| 69. | [ru/date/weekday](../src/rules/ru/date/weekday.js) | 2 Мая, Понедельник → 2 мая, понедельник | 1310 | | ✓ | | ||
| 70. | [common/html/mail](../src/rules/common/html/mail.js) | Расстановка ссылок для эл. почты | 2000 | | | | ||
| 71. | [common/html/url](../src/rules/common/html/url.js) | Расстановка ссылок | 2010 | | | | ||
| 72. | [common/html/pbr](../src/rules/common/html/pbr.js) | Расстановка тегов p и br | 90 | end | | | ||
| 73. | [common/html/stripTags](../src/rules/common/html/stripTags.js) | Удаление HTML-тегов | 100 | end | | | ||
| 74. | [common/html/escape](../src/rules/common/html/escape.js) | Экранирование HTML | 110 | end | | | ||
| 1. | [common/html/e-mail](../src/rules/common/html/e-mail.js) | Расстановка ссылок для эл. почты | 1110 | | | | ||
| 2. | [common/html/escape](../src/rules/common/html/escape.js) | Экранирование HTML | 1210 | end | | | ||
| 3. | [common/html/nbr](../src/rules/common/html/nbr.js) | Замена перевода строки на <br/> | 1115 | end | | | ||
| 4. | [common/html/pbr](../src/rules/common/html/pbr.js) | Расстановка тегов p и br | 1110 | end | | | ||
| 5. | [common/html/stripTags](../src/rules/common/html/stripTags.js) | Удаление HTML-тегов | 1209 | end | | | ||
| 6. | [common/html/url](../src/rules/common/html/url.js) | Расстановка ссылок | 1110 | | | | ||
| 7. | [common/nbsp/afterNumber](../src/rules/common/nbsp/afterNumber.js) | Нераз. пробел между числом и словом | 510 | | | | ||
| 8. | [common/nbsp/afterParagraph](../src/rules/common/nbsp/afterParagraph.js) | Нераз. пробел после § | 510 | | ✓ | | ||
| 9. | [common/nbsp/afterShortWord](../src/rules/common/nbsp/afterShortWord.js) | Нераз. пробел после короткого слова | 510 | | ✓ | | ||
| 10. | [common/nbsp/beforeShortLastWord](../src/rules/common/nbsp/beforeShortLastWord.js) | Нераз. пробел перед последним коротким словом в предложении | 510 | | ✓ | | ||
| 11. | [common/nbsp/dpi](../src/rules/common/nbsp/dpi.js) | Нераз. пробел перед lpi и dpi | 510 | | ✓ | | ||
| 12. | [common/nbsp/nowrap](../src/rules/common/nbsp/nowrap.js) | Заменять нераз. пробел на обычный пробел в тегах nowrap и nobr | 510 | end | ✓ | | ||
| 13. | [common/nbsp/replaceNbsp](../src/rules/common/nbsp/replaceNbsp.js) | Замена неразрывного пробела на обычный | 510 | utf | ✓ | | ||
| 14. | [common/number/fraction](../src/rules/common/number/fraction.js) | 1/2 → ½, 1/4 → ¼, 3/3 → ¾ | 610 | | ✓ | | ||
| 15. | [common/number/mathSigns](../src/rules/common/number/mathSigns.js) | != → ≠, <= → ≤, >= → ≥, ~= → ≅, +- → ± | 610 | | ✓ | | ||
| 16. | [common/number/times](../src/rules/common/number/times.js) | x → × (10 x 5 → 10×5) | 610 | | ✓ | | ||
| 17. | [common/other/delBOM](../src/rules/common/other/delBOM.js) | Удаление символа BOM (Byte Order Mark) | -1 | start | ✓ | | ||
| 18. | [common/other/repeatWord](../src/rules/common/other/repeatWord.js) | Удаление повтора слова | 910 | | | | ||
| 19. | [common/punctuation/delDoublePunctuation](../src/rules/common/punctuation/delDoublePunctuation.js) | Удаление двойной пунктуации | 410 | | ✓ | | ||
| 20. | [common/space/afterPunctuation](../src/rules/common/space/afterPunctuation.js) | Пробел после знаков пунктуации | 210 | | ✓ | | ||
| 21. | [common/space/beforeBracket](../src/rules/common/space/beforeBracket.js) | Пробел перед открывающей скобкой | 210 | | ✓ | | ||
| 22. | [common/space/bracket](../src/rules/common/space/bracket.js) | Удаление лишних пробелов после открывающей и перед закрывающей скобки | 210 | | ✓ | | ||
| 23. | [common/space/delBeforePercent](../src/rules/common/space/delBeforePercent.js) | Удаление пробела перед %, ‰ и ‱ | 210 | | ✓ | | ||
| 24. | [common/space/delBeforePunctuation](../src/rules/common/space/delBeforePunctuation.js) | Удаление пробелов перед знаками пунктуации | 210 | | ✓ | | ||
| 25. | [common/space/delLeadingBlanks](../src/rules/common/space/delLeadingBlanks.js) | Удаление пробелов в начале строки | 210 | | | | ||
| 26. | [common/space/delRepeatN](../src/rules/common/space/delRepeatN.js) | Удаление повторяющихся переносов строки (от трёх и более) | 209 | | ✓ | | ||
| 27. | [common/space/delRepeatSpace](../src/rules/common/space/delRepeatSpace.js) | Удаление повторяющихся пробелов между символами | 209 | | ✓ | | ||
| 28. | [common/space/delTrailingBlanks](../src/rules/common/space/delTrailingBlanks.js) | Удаление пробелов в конце строки | 207 | | ✓ | | ||
| 29. | [common/space/replaceTab](../src/rules/common/space/replaceTab.js) | Замена таба на 4 пробела | 205 | | ✓ | | ||
| 30. | [common/space/squareBracket](../src/rules/common/space/squareBracket.js) | Удаление лишних пробелов после открывающей и перед закрывающей квадратной скобки | 210 | | ✓ | | ||
| 31. | [common/space/trimLeft](../src/rules/common/space/trimLeft.js) | Удаление пробелов и переносов строк в начале текста | 206 | | ✓ | | ||
| 32. | [common/space/trimRight](../src/rules/common/space/trimRight.js) | Удаление пробелов и переносов строк в конце текста | 207 | | ✓ | | ||
| 33. | [common/symbols/arrow](../src/rules/common/symbols/arrow.js) | -> → →, <- → ← | 110 | | ✓ | | ||
| 34. | [common/symbols/cf](../src/rules/common/symbols/cf.js) | Добавление ° к C и F | 110 | | ✓ | | ||
| 35. | [common/symbols/copy](../src/rules/common/symbols/copy.js) | (c) → ©, (tm) → ™, (r) → ® | 110 | | ✓ | | ||
| 36. | [en/punctuation/quote](../src/rules/en/punctuation/quote.js) | Расстановка кавычек | 410 | | ✓ | | ||
| 37. | [ru/dash/centuries](../src/rules/ru/dash/centuries.js) | Замена дефиса на тире в веках | 310 | | ✓ | | ||
| 38. | [ru/dash/daysMonth](../src/rules/ru/dash/daysMonth.js) | Тире между днями одного месяца | 310 | | ✓ | | ||
| 39. | [ru/dash/decade](../src/rules/ru/dash/decade.js) | Тире в десятилетиях, 80—90-е гг. | 310 | | ✓ | | ||
| 40. | [ru/dash/directSpeech](../src/rules/ru/dash/directSpeech.js) | Тире в прямой речи | 310 | | ✓ | | ||
| 41. | [ru/dash/izpod](../src/rules/ru/dash/izpod.js) | Дефис между «из-под» | 310 | | ✓ | | ||
| 42. | [ru/dash/izza](../src/rules/ru/dash/izza.js) | Дефис между «из-за» | 310 | | ✓ | | ||
| 43. | [ru/dash/kade](../src/rules/ru/dash/kade.js) | Дефис перед «ка», «де», «кась» | 310 | | ✓ | | ||
| 44. | [ru/dash/koe](../src/rules/ru/dash/koe.js) | Дефис после «кое» и «кой» | 310 | | ✓ | | ||
| 45. | [ru/dash/main](../src/rules/ru/dash/main.js) | Замена дефиса на тире | 305 | | ✓ | | ||
| 46. | [ru/dash/month](../src/rules/ru/dash/month.js) | Тире между месяцами | 310 | | ✓ | | ||
| 47. | [ru/dash/surname](../src/rules/ru/dash/surname.js) | Сокращения с помощью тире | 310 | | ✓ | | ||
| 48. | [ru/dash/taki](../src/rules/ru/dash/taki.js) | Дефис между «верно-таки» и т. д. | 310 | | ✓ | | ||
| 49. | [ru/dash/time](../src/rules/ru/dash/time.js) | Тире в интервалах времени | 310 | | ✓ | | ||
| 50. | [ru/dash/to](../src/rules/ru/dash/to.js) | Дефис перед «то», «либо», «нибудь» | 310 | | ✓ | | ||
| 51. | [ru/dash/weekday](../src/rules/ru/dash/weekday.js) | Тире между днями недели | 310 | | ✓ | | ||
| 52. | [ru/dash/years](../src/rules/ru/dash/years.js) | Замена дефиса на тире в годах | 310 | | ✓ | | ||
| 53. | [ru/date/fromISO](../src/rules/ru/date/fromISO.js) | Преобразование дат YYYY-MM-DD к виду DD.MM.YYYY | 810 | | ✓ | | ||
| 54. | [ru/date/weekday](../src/rules/ru/date/weekday.js) | 2 Мая, Понедельник → 2 мая, понедельник | 810 | | ✓ | | ||
| 55. | [ru/money/dollar](../src/rules/ru/money/dollar.js) | $100 → 100 $ | 710 | | ✓ | | ||
| 56. | [ru/money/euro](../src/rules/ru/money/euro.js) | €100 → 100 € | 710 | | ✓ | | ||
| 57. | [ru/money/ruble](../src/rules/ru/money/ruble.js) | 1 руб. → 1 ₽ | 710 | | | | ||
| 58. | [ru/nbsp/abbr](../src/rules/ru/nbsp/abbr.js) | Нераз. пробел в сокращениях, например, в “т. д.” | 510 | | ✓ | | ||
| 59. | [ru/nbsp/addr](../src/rules/ru/nbsp/addr.js) | Расстановка неразрывного пробела после «г.», «обл.», «ул.», «пр.», «кв.» и др. | 510 | | ✓ | | ||
| 60. | [ru/nbsp/afterNumberSign](../src/rules/ru/nbsp/afterNumberSign.js) | Нераз. пробел после № | 510 | | ✓ | | ||
| 61. | [ru/nbsp/beforeParticle](../src/rules/ru/nbsp/beforeParticle.js) | Нераз. пробел перед «ли», «ль», «же», «бы», «б» | 515 | | ✓ | | ||
| 62. | [ru/nbsp/centuries](../src/rules/ru/nbsp/centuries.js) | Удаление пробелов и лишних точек в «вв.» | 510 | | ✓ | | ||
| 63. | [ru/nbsp/dayMonth](../src/rules/ru/nbsp/dayMonth.js) | Нераз. пробел между числом и месяцем | 510 | | ✓ | | ||
| 64. | [ru/nbsp/m](../src/rules/ru/nbsp/m.js) | м2 → м², м3 → м³ и нераз. пробел | 515 | | ✓ | | ||
| 65. | [ru/nbsp/ooo](../src/rules/ru/nbsp/ooo.js) | Нераз. пробел после OOO, ОАО, ЗАО, НИИ и ПБОЮЛ | 510 | | ✓ | | ||
| 66. | [ru/nbsp/page](../src/rules/ru/nbsp/page.js) | Нераз. пробел после «стр.», «гл.», «рис.», «илл.» | 510 | | ✓ | | ||
| 67. | [ru/nbsp/ps](../src/rules/ru/nbsp/ps.js) | Нераз. пробел в P. S. и P. P. S. | 510 | | ✓ | | ||
| 68. | [ru/nbsp/see](../src/rules/ru/nbsp/see.js) | Нераз. пробел после сокращений «см.» и «им.» | 510 | | ✓ | | ||
| 69. | [ru/nbsp/year](../src/rules/ru/nbsp/year.js) | Нераз. пробел после XXXX г. (2012 г.) | 510 | | ✓ | | ||
| 70. | [ru/nbsp/years](../src/rules/ru/nbsp/years.js) | г.г. → гг. и нераз. пробел | 515 | | ✓ | | ||
| 71. | [ru/number/ordinals](../src/rules/ru/number/ordinals.js) | N-ый, -ой, -ая, -ое, -ые, -ым, -ом, -ых → N-й, -я, -е, -м, -х (25-й) | 610 | | ✓ | | ||
| 72. | [ru/optalign/bracket](../src/rules/ru/optalign/bracket.js) | для открывающей скобки | 1010 | | | | ||
| 73. | [ru/optalign/comma](../src/rules/ru/optalign/comma.js) | для запятой | 1010 | | | | ||
| 74. | [ru/optalign/quote](../src/rules/ru/optalign/quote.js) | для открывающей кавычки | 1010 | | | | ||
| 75. | [ru/other/accent](../src/rules/ru/other/accent.js) | Замена заглавной буквы на строчную с добавлением ударения | 910 | | | | ||
| 76. | [ru/punctuation/ano](../src/rules/ru/punctuation/ano.js) | Расстановка запятых перед «а» и «но» | 410 | | ✓ | | ||
| 77. | [ru/punctuation/apostrophe](../src/rules/ru/punctuation/apostrophe.js) | Расстановка правильного апострофа | 405 | | ✓ | | ||
| 78. | [ru/punctuation/exclamation](../src/rules/ru/punctuation/exclamation.js) | !! → ! | 410 | | ✓ | | ||
| 79. | [ru/punctuation/exclamationQuestion](../src/rules/ru/punctuation/exclamationQuestion.js) | !? → ?! | 415 | | ✓ | | ||
| 80. | [ru/punctuation/hellip](../src/rules/ru/punctuation/hellip.js) | Три точки на многоточие, ?... → ?.. и пр. | 410 | | ✓ | | ||
| 81. | [ru/punctuation/quote](../src/rules/ru/punctuation/quote.js) | Расстановка кавычек | 410 | | ✓ | | ||
| 82. | [ru/space/afterHellip](../src/rules/ru/space/afterHellip.js) | Пробел после ..., !.. и ?.. | 210 | | ✓ | | ||
| 83. | [ru/space/year](../src/rules/ru/space/year.js) | Пробел между числом и словом «год» | 210 | | ✓ | |
{ | ||
"name": "typograf", | ||
"description": "The client and server typographer", | ||
"version": "3.5.0", | ||
"version": "4.0.0", | ||
"author": { | ||
@@ -11,5 +11,2 @@ "name": "Denis Seleznev", | ||
"main": "dist/typograf.js", | ||
"bin": { | ||
"typograf": "./bin/cli.js" | ||
}, | ||
"homepage": "https://github.com/typograf", | ||
@@ -37,6 +34,2 @@ "license": "MIT", | ||
], | ||
"dependencies": { | ||
"commander": "~2.8.1", | ||
"isutf8": "~1.0.10" | ||
}, | ||
"devDependencies": { | ||
@@ -47,3 +40,3 @@ "chai": "~3.3.0", | ||
"gulp-filter": "~3.0.0", | ||
"gulp-jscs": "~2.0.0", | ||
"gulp-jscs": "~3.0.1", | ||
"gulp-jshint": "~1.11.2", | ||
@@ -55,3 +48,3 @@ "gulp-jsonlint": "^1.0.2", | ||
"istanbul": "~0.3.5", | ||
"jscs": "~2.1.0", | ||
"jscs": "~2.2.1", | ||
"jshint": "~2.8.0", | ||
@@ -58,0 +51,0 @@ "mocha": "~2.3.3", |
@@ -36,7 +36,7 @@ Типограф на JavaScript | ||
``` | ||
bower install typograf | ||
npm install typograf | ||
``` | ||
```HTML | ||
<script src="dist/typograf.min.js"></script> | ||
<script src="./node_modules/typograf/dist/typograf.min.js"></script> | ||
<script> | ||
@@ -64,14 +64,4 @@ var tp = new Typograf({lang: 'ru'}); | ||
### Командная строка | ||
``` | ||
npm install typograf -g | ||
``` | ||
`typograf` — вывод справки | ||
### [Командный интерфейс](https://github.com/typograf/typograf-cli) | ||
`typograf -l ru my_file.txt` — типографировать текст по русским правилам | ||
`typograf -l en my_file.txt` — типографировать файл по английским правилам | ||
`typograf -l ru -d ru/punctuation/quot -e ru/optaling/* my_file.txt > new_my_file` — типографировать файл с отключенным правилом `ru/punctuation/quot` и включенными правилами `ru/optaling/*` | ||
## API | ||
@@ -111,3 +101,3 @@ ### Висячая пунктуация | ||
// Название правила, название настройки, значение | ||
tp.setting('common/nbsp/beforeShortLast', 'lengthLastWord', 5); | ||
tp.setting('common/nbsp/beforeShortLastWord', 'lengthLastWord', 5); | ||
``` | ||
@@ -165,3 +155,3 @@ | ||
## [Лицензия](./LICENSE.ru.md) | ||
## [Лицензия](./LICENSE.md) | ||
MIT License | ||
@@ -168,0 +158,0 @@ |
Sorry, the diff of this file is not supported yet
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
174493
0
2633
0
1
70
160
- Removedcommander@~2.8.1
- Removedisutf8@~1.0.10
- Removedcommander@2.8.1(transitive)
- Removedgraceful-readlink@1.0.1(transitive)
- Removedisutf8@1.0.11(transitive)