Skip to content

Suggestion: Change Description Wrapper Element to a "div" or "span" element instead of paragraph #50

@schaper1337

Description

@schaper1337

Im trying to render markdown content from a record attribute, which is saved via the filament markdown editor.

The Markdown Content, when transformed to a HtmlString instance, typically contains <p> tags.

This does not play well with the Description Wrapper Element, which is also a p-tag, as nesting <p> tags directly within <p> is not allowed per spec.
As a result, the styles (or any other attributes) of the description wrapper have no effect on the actual description content, as it is interpreted by browsers as being outside of this scope.

Code to reproduce:

\CodeWithDennis\SimpleAlert\Components\Infolists\SimpleAlert::make('additional_information')
  ->title("Sticky Notes")
  ->description(fn($record) => str($record->field)->markdown()->toHtmlString())

alternatively you could just omit a HtmlString instance to the description method which gives the same outcome:

Image

Suggestion:
Change the Description Wrapper to a <div> like:

<div class="block text-sm text-custom-700 dark:text-white"> ... </div>

so that paragraphs can be nested inside of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions