Using Markdown with Phplugins

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!

Buy Me A Coffee


Leave a Reply

Your email address will not be published. Required fields are marked *

Web Design Consulting

Do you need help designing your web site or getting Backlight working the way you want? Contact me to discuss your idea or project.

Buy me a Coffee

If you like what I share here, please consider buying me a coffee or a print. This helps keeping me motivated to continue posting. Thank you!

Buy Me A Coffee