It couldn’t be simpler than that:
echo Markdown::text('my markdown code');
Or you can have text that spans several lines:
echo Markdown::text('Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus semper ipsum nibh. Proin vitae erat at enim semper placerat non in metus. Praesent et sodales orci.
');
Or you can assign text to a variable and then output that content using the Markdown parser:
$my_text = 'Lorem ipsum dolor sit amet,';
$my_text .= ' consectetur adipiscing elit.';
echo Markdown::text($my_text);
This last examples shows as well how you could add text to an already existing variable.
Please note that this will not work with WordPress based pages! But as with many other things, there are WordPress plugins available adding this feature.
Did you like this post? Did you use the given code? Please consider supporting me by buying me a coffee!
Thanks!