Skip to content

Commit 44f0405

Browse files
committed
Updated "unbreakable-punctuation" to "non-breaking-punctuation"
1 parent 4b57338 commit 44f0405

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Typography Rules for Laravel
22

3-
Rendering strings provided by users can result in unexpected typographic results. For instance, in most latin languages (such as french) it is recommended to add a non-breakable space in front of, amongst others, exclamation or question marks (`!` and `?`). Most users will probably just type a regular space, which could result in an unwanted line break just before these punctuation marks.
3+
Rendering strings provided by users can result in unexpected typographic results. For instance, in most latin languages (such as french) it is recommended to add a non-breaking space in front of, amongst others, exclamation or question marks (`!` and `?`). Most users will probably just type a regular space, which could result in an unwanted line break just before these punctuation marks.
44

55
This simple package provides a `typography` macro for Laravel's `Str` facade and `Stringable` instances (created using `Str::of()` or `str()`) that will take care of these typographic details.
66

@@ -46,7 +46,7 @@ Using `Stringable` instances, you can chain `typography` with other helper metho
4646

4747
| Key | Usage | Description |
4848
|:------------------------- |:--------------------------------------------------- |:--------------------------------------------------------------------------------------------- |
49-
| `unbreakable-punctuation` | Remove unwanted line breaks in front of punctuation | Replaces ` !`, ` ?`, ` :`, ` ;` with ` !`, ` ?`, ` :`, ` ;` respectively. |
49+
| `non-breaking-punctuation` | Remove unwanted line breaks in front of punctuation | Replaces ` !`, ` ?`, ` :`, ` ;` with ` !`, ` ?`, ` :`, ` ;` respectively. |
5050
| `hellip` | Use the correct "horizontal ellipsis" HTML entity | Replaces `…`, `…`, `...`, `` with `…`. |
5151

5252
## Registering & removing typographic rules
@@ -75,14 +75,14 @@ Call a single or a few specific rules:
7575

7676
```blade
7777
<div>{!! str($text)->typography(only: 'hellip') !!}</div>
78-
<div>{!! str($text)->typography(only: ['hellip', 'unbreakable-punctuation']) !!}</div>
78+
<div>{!! str($text)->typography(only: ['hellip', 'non-breaking-punctuation']) !!}</div>
7979
```
8080

8181
Call all rules except a single or a few specific unwanted rules:
8282

8383
```blade
8484
<div>{!! str($text)->typography(except: 'hellip') !!}</div>
85-
<div>{!! str($text)->typography(except: ['hellip', 'unbreakable-punctuation']) !!}</div>
85+
<div>{!! str($text)->typography(except: ['hellip', 'non-breaking-punctuation']) !!}</div>
8686
```
8787

8888
---

src/ServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ServiceProvider extends Provider
1414
public function register()
1515
{
1616
Typography::rule(
17-
key: 'unbreakable-punctuation',
17+
key: 'non-breaking-punctuation',
1818
regex: '/(?:(?:&nbsp;)|\s)+([:!?;])/',
1919
callback: fn(array $matches) => '&nbsp;'.$matches[1],
2020
);

0 commit comments

Comments
 (0)