Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Правило для расстановки неразр. пробела перед числом в конце предложе…
…ния #140
- Loading branch information
Showing
9 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
Typograf.data({ | ||
'en/l': 'a-z', | ||
'en/ld': 'a-z\\d', | ||
'en/L': 'A-Z', | ||
'en/lL': 'a-zA-Z' | ||
'en/Ld': 'A-Z\\d', | ||
'en/lL': 'a-zA-Z', | ||
'en/lLd': 'a-zA-Z\\d' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Typograf.data('en/rquote', '”’'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
Typograf.data({ | ||
'ru/l': 'а-яёa-z', | ||
'ru/ld': 'а-яёa-z\\d', | ||
'ru/L': 'А-ЯЁA-Z', | ||
'ru/lL': 'а-яёА-ЯЁa-zA-Z' | ||
'ru/Ld': 'А-ЯЁA-Z\\d', | ||
'ru/lL': 'а-яёА-ЯЁa-zA-Z', | ||
'ru/lLd': 'а-яёА-ЯЁa-zA-Z\\d' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Typograf.data('ru/rquote', '»“‘'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Typograf.rule({ | ||
name: 'common/nbsp/beforeShortLastNumber', | ||
handler: function(text, settings) { | ||
var re = new RegExp('([' + this._data('lL') + | ||
']) (?=\\d{1,' + settings.lengthLastNumber + | ||
'}[-+−%\'"' + this._data('rquote') + ']?([.!?…]( [' + | ||
this._data('L') + ']|$)|$))', 'gm'); | ||
|
||
return text.replace(re, '$1\u00A0'); | ||
}, | ||
settings: { | ||
lengthLastNumber: 2 | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"en": "Non-breaking space before number (maximum 2 digits) at end of sentence", | ||
"ru": "Нераз. пробел перед числом (не более 2 цифр) в конце предложения" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
tests.push(['common/nbsp/beforeShortLastNumber', [ | ||
[ | ||
'Сегодня я получил 5. И очень рад.', | ||
'Сегодня я получил\u00A05. И очень рад.', | ||
'ru' | ||
], | ||
[ | ||
'Сегодня я получил 5\nИ дальше продолжаю стих', | ||
'Сегодня я получил\u00A05\nИ дальше продолжаю стих', | ||
'ru' | ||
], | ||
[ | ||
'Сегодня я получил 5+', | ||
'Сегодня я получил\u00A05+', | ||
'ru' | ||
], | ||
[ | ||
'или 5-', | ||
'или\u00A05-', | ||
'ru' | ||
], | ||
[ | ||
'Доллар вырос на 1%.\nДоллар вырос на 2%.', | ||
'Доллар вырос на\u00A01%.\nДоллар вырос на\u00A02%.', | ||
'ru' | ||
], | ||
[ | ||
'Сегодня диагональ равна 5"', | ||
'Сегодня диагональ равна\u00A05"', | ||
'ru' | ||
], | ||
[ | ||
'Пять секунд некоторые пишут в виде 5\'', | ||
'Пять секунд некоторые пишут в виде\u00A05\'', | ||
'ru' | ||
], | ||
[ | ||
'"Справка 09"', | ||
'"Справка\u00A009"', | ||
'ru' | ||
] | ||
]]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,7 +180,7 @@ var ruTests = [ | |
], | ||
[ | ||
'"Справка 09"', | ||
'«Справка 09»' | ||
'«Справка\u00A009»' | ||
], | ||
[ | ||
'"новый тариф*"', | ||
|