-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14419 from Plytas/4.x
Added markdown extensions support
- Loading branch information
Showing
6 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Filament\Support\Concerns; | ||
|
||
use Closure; | ||
use League\CommonMark\Extension\ExtensionInterface; | ||
|
||
trait CanConfigureCommonMark | ||
{ | ||
/** | ||
* @var array<string, mixed> | Closure | null | ||
*/ | ||
protected array | Closure | null $commonMarkOptions = null; | ||
|
||
/** | ||
* @var array<array-key, ExtensionInterface> | Closure | null | ||
*/ | ||
protected array | Closure | null $commonMarkExtensions = null; | ||
|
||
/** | ||
* @param array<string, mixed> | Closure | null $commonMarkOptions | ||
*/ | ||
public function commonMarkOptions(array | Closure | null $commonMarkOptions): static | ||
{ | ||
$this->commonMarkOptions = $commonMarkOptions; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function getCommonMarkOptions(): array | ||
{ | ||
return $this->evaluate($this->commonMarkOptions) ?? []; | ||
} | ||
|
||
/** | ||
* @param array<array-key, ExtensionInterface> | Closure | null $commonMarkExtensions | ||
*/ | ||
public function commonMarkExtensions(array | Closure | null $commonMarkExtensions): static | ||
{ | ||
$this->commonMarkExtensions = $commonMarkExtensions; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return array<array-key, ExtensionInterface> | ||
*/ | ||
public function getCommonMarkExtensions(): array | ||
{ | ||
return $this->evaluate($this->commonMarkExtensions) ?? []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters