Custom page render Markdown
Hi guys!
I have an issue of rendering a markdown text on a custom page which is in the end a Cluster.
Any solution?
I've tried via:
{!! str($markdownContent)->markdown()->sanitizeHtml() !!} but nothing works at it should format the markdown.30 Replies
You probably didn't add any styling to it? For Tailwind there is
prose.Is not rendering at all the markdown content is not about the Tailwind at all.
No content at all?
Where does it break?
What does just
$markdownContent or str($markdownContent)->markdown() render?
Not sure whether sanitizeHtml won't break markdown, because that's HTMLLists
Unordered
+ Create a list by starting a line with
+, -, or *
+ Sub-lists are made by indenting 2 spaces:
- Marker character change forces new list start:
* Ac tristique libero volutpat at
+ Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
+ Very easy!
I was trying something like this but it doesn't render as a markdown but as a simple stringYou said it doesn't render anything at all?
What does the HTML of that "simple string" look like? Can you send a screenshot from the dev tools?
Hi @Dennis Koch
I'm currently running into the same/similar problem.
Markdown is rendering but it completely ignores the # (<h1>...<h5>) tags.
How can I fix this?
Is it rendering the HTML properly? Do you have a custom theme?
I have a custom theme. Yes it is rendering the HTML, no tags are being displayed. When I do
**bold** the text is in boldAlso the h1...h6 tags?
The h1...h6 tags are not being rendered properly, they all have the same text size / style
This is in my file:
The output is in the image

this is the html

Try fi-prose instead of prose
That did it, thanks !
There might even be a ->prose() method to do it for you.
let me check
on the
Text component?Not sure if the Text component has that. I might be thinking of the TextEntry component
Ah okay, I will check it out
Text does not have itWhatever works.
yes it does
Thanks !
Sounds like you didn't compile your theme or the file is not included in the sources.
But yeah, forgot that Filament ships with a
fi-proseMakes sense, prime components probably don’t have a lot of the helper methods like ->prose() since they are lower level.
What do you mean with "compile"? Running
npm run build?Yep.
The files are in my sources, they are in one of the subfolders :
I just did that, that didn't change it
That's the issue. This code is not in
resources/views
this is the file path
This is my complete file:
If you’re in a panel then stick to .fi-prose, otherwise you’re going to have a lot of headaches.
Okay, that one should cover it:
@source '../../../../app/Filament/**/*';The component is in:
./app/Filament/Lms/Pages/Rules.php
I will use TextEntry, thanks again !