Skip to content

Commit

Permalink
inch by ,./ (#13)
Browse files Browse the repository at this point in the history
* inch by ,./

* inch test

* changelog
  • Loading branch information
akhx committed Feb 20, 2024
1 parent e3f8aee commit ee8f30b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog
## [Unreleased](https://github.com/akhx/typograf/compare/v0.4.9...HEAD)
## [Unreleased](https://github.com/akhx/typograf/compare/v0.4.10...HEAD)

## [0.4.10](https://github.com/akhx/typograf/compare/v0.4.9...v0.4.10) - 2024-02-20
* support php 8.3
* fix inch .,/

## [0.4.9](https://github.com/akhx/typograf/compare/v0.4.8...v0.4.9) - 2023-04-21
* fix remove html entity in DelDouble
Expand Down
2 changes: 1 addition & 1 deletion src/Rule/Quote/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function setInch(string $text): string
return $text;
}

return preg_replace('/(^|[0-9])\/([0-9]+)(»)/u', '$1/$2″', $text);
return preg_replace('/(^|[0-9])([\/,.])([0-9]+)(»)/u', '$1$2$3″', $text);
}

protected function setInner(string $text): string
Expand Down
8 changes: 8 additions & 0 deletions tests/Rule/Quote/QuoteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ public function dataProvider(): array
'»история наоборот»',
'«история наоборот»',
],
[
'Линза 1,5"',
'Линза 1,5″',
],
[
'Линза 1.5"',
'Линза 1.5″',
],
];
}

Expand Down

0 comments on commit ee8f30b

Please sign in to comment.