Skip to content

Commit

Permalink
Merge pull request #443 from typograf/lermontov
Browse files Browse the repository at this point in the history
Add non-breaking spaces to initials in parentheses
  • Loading branch information
hcodes committed Nov 24, 2023
2 parents ff82e0c + 247567c commit 5f3e5df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/rules/ru/nbsp/initials.test.ts
Expand Up @@ -5,6 +5,10 @@ typografRuleTest(['ru/nbsp/initials', [
'А.С. Пушкин',
'А.\u00A0С.\u00A0Пушкин'
],
[
'(М. Ю. Лермонтов)',
'(М.\u00A0Ю.\u00A0Лермонтов)'
],
[
'В.И. Немирович-Данченко',
'В.\u00A0И.\u00A0Немирович-Данченко'
Expand Down
2 changes: 1 addition & 1 deletion src/rules/ru/nbsp/initials.ts
Expand Up @@ -7,7 +7,7 @@ export const initialsRule: TypografRule = {
handler(text) {
const spaces = '\u00A0\u202F '; // nbsp, thinsp
const quote = getData('ru/quote') as DataQuote;
const re = new RegExp('(^|[' + spaces +
const re = new RegExp('(^|[(' + spaces +
quote.left +
privateLabel +
'"])([А-ЯЁ])\\.[' + spaces + ']?([А-ЯЁ])\\.[' + spaces +
Expand Down

0 comments on commit 5f3e5df

Please sign in to comment.