Skip to content

Commit

Permalink
Add a more sensible default config that does not string hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrono committed Jan 18, 2021
1 parent d215816 commit 974898a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config/f9web-laravel-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@
| Title tag replacements
|--------------------------------------------------------------------------
|
| Optionally replace specific title characters. By default a hyphen
| is replaced by a space
| Optionally replace specific title characters. By default, no characters
| are replaced.
|
*/
'meta-title-replacements' => [
'enabled' => true,

'search' => [
'-',
'',
],

'replace' => [
Expand Down
2 changes: 1 addition & 1 deletion src/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Meta implements Htmlable
public static function setRawTags(array $tags = []): self
{
array_map(
function ($tag) {
static function ($tag) {
self::setRawTag($tag);
},
$tags
Expand Down
2 changes: 1 addition & 1 deletion tests/MetaTitleTagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function it_renders_the_expected_title_when_hyphens_are_present()
// given the title is not set and a default exists
$this->app['config']->set(
[
'f9web-laravel-meta.fallback-meta-title' => 'App-Name',
'f9web-laravel-meta.fallback-meta-title' => 'App Name',
'f9web-laravel-meta.meta-title-append' => null,
]
);
Expand Down
9 changes: 9 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ public function tearDown(): void
'enabled' => true,
'method' => 'route',
],
'meta-title-replacements' => [
'enabled' => true,
'search' => [
'-',
],
'replace' => [
' ',
]
],
'removable-uri-segments' => [
'/public',
'/index.php',
Expand Down

0 comments on commit 974898a

Please sign in to comment.