You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
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.
4
4
5
-
This simple package provides a `typography` macro to Laravel's `Str` facade and `Stringable` instances (created using `Str::of()` or `str()`) that will take care of these typographic details.
5
+
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.
6
6
7
-
It is also possible to enhance the package by adding your own typographic rules.
7
+
It is also possible to enhance this package by adding your own typographic rules.
The package's ServiceProvider and therefore its `typography` macro will automatically be registered upon installation so you can start using it right away:
26
+
The package's ServiceProvider and therefore its `typography` macro will automatically be registered upon installation. You can start using it right away:
27
27
28
28
```blade
29
-
<!-- Using the Str facade -->
29
+
{{-- Using the "Str" facade --}}
30
30
<h1>{!! Str::typography($title) !!}</h1>
31
-
<!-- Using the str() helper method -->
31
+
32
+
{{-- Using the "str()" helper --}}
32
33
<p>{!! str($paragraph)->typography() !!}</p>
33
34
```
34
35
35
-
Using `Stringable` instances, you can chain the `typography`method with other helpers:
36
+
Using `Stringable` instances, you can chain `typography` with other helper methods:
> Since the transformed strings contain HTML entities (such as ` `), don't forget to render them using `{!! !!}` instead of `{{ }}` in your Blade templates.
0 commit comments