Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added markdown extensions support #14419

Draft
wants to merge 1 commit into
base: 4.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div
class="fi-fo-markdown-editor fi-disabled prose block w-full max-w-none rounded-lg bg-gray-50 px-3 py-3 text-gray-500 shadow-sm ring-1 ring-gray-950/10 dark:prose-invert dark:bg-transparent dark:text-gray-400 dark:ring-white/10 sm:text-sm"
>
{!! str($getState())->markdown()->sanitizeHtml() !!}
{!! str($getState())->sanitizeHtml()->markdown($getOptions() ?? [], $getExtensions() ?? []) !!}
</div>
@else
<x-filament::input.wrapper
Expand Down
28 changes: 28 additions & 0 deletions packages/forms/src/Components/MarkdownEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,32 @@
'table',
'undo',
];

protected array | Closure | null $options = null;

Check failure on line 42 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L11.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$options type has no value type specified in iterable type array.

Check failure on line 42 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$options type has no value type specified in iterable type array.

Check failure on line 42 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$options type has no value type specified in iterable type array.

Check failure on line 42 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$options type has no value type specified in iterable type array.

Check failure on line 42 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$options type has no value type specified in iterable type array.

protected array | Closure | null $extensions = null;

Check failure on line 44 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L11.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$extensions type has no value type specified in iterable type array.

Check failure on line 44 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$extensions type has no value type specified in iterable type array.

Check failure on line 44 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$extensions type has no value type specified in iterable type array.

Check failure on line 44 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$extensions type has no value type specified in iterable type array.

Check failure on line 44 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Property Filament\Forms\Components\MarkdownEditor::$extensions type has no value type specified in iterable type array.

public function options(array | Closure | null $options): static

Check failure on line 46 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L11.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::options() has parameter $options with no value type specified in iterable type array.

Check failure on line 46 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::options() has parameter $options with no value type specified in iterable type array.

Check failure on line 46 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::options() has parameter $options with no value type specified in iterable type array.

Check failure on line 46 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::options() has parameter $options with no value type specified in iterable type array.

Check failure on line 46 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::options() has parameter $options with no value type specified in iterable type array.
{
$this->options = $options;

return $this;
}

public function getOptions(): ?array

Check failure on line 53 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L11.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getOptions() return type has no value type specified in iterable type array.

Check failure on line 53 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getOptions() return type has no value type specified in iterable type array.

Check failure on line 53 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getOptions() return type has no value type specified in iterable type array.

Check failure on line 53 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getOptions() return type has no value type specified in iterable type array.

Check failure on line 53 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getOptions() return type has no value type specified in iterable type array.
{
return $this->evaluate($this->options);
}

public function extensions(array | Closure | null $extensions): static

Check failure on line 58 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L11.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::extensions() has parameter $extensions with no value type specified in iterable type array.

Check failure on line 58 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::extensions() has parameter $extensions with no value type specified in iterable type array.

Check failure on line 58 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::extensions() has parameter $extensions with no value type specified in iterable type array.

Check failure on line 58 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::extensions() has parameter $extensions with no value type specified in iterable type array.

Check failure on line 58 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::extensions() has parameter $extensions with no value type specified in iterable type array.
{
$this->extensions = $extensions;

return $this;
}

public function getExtensions(): ?array

Check failure on line 65 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L11.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getExtensions() return type has no value type specified in iterable type array.

Check failure on line 65 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.3 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getExtensions() return type has no value type specified in iterable type array.

Check failure on line 65 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getExtensions() return type has no value type specified in iterable type array.

Check failure on line 65 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.2 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getExtensions() return type has no value type specified in iterable type array.

Check failure on line 65 in packages/forms/src/Components/MarkdownEditor.php

View workflow job for this annotation

GitHub Actions / P8.1 - L10.* - prefer-stable

Method Filament\Forms\Components\MarkdownEditor::getExtensions() return type has no value type specified in iterable type array.
{
return $this->evaluate($this->extensions);
}
}
Loading