Search the blog

Normally, if you need to output Markdown in ProcessWire you use the TextformatterMarkdownExtra Textformatter module.

However, you might need to do it programatically. If so, here’s how you do it:

$sanitizer->entitiesMarkdown($string);

This only parses basic markdown. Pass true as the second parameter to parse full markdown. For more control, instead of passing true, pass an $options array. See the ProcessWire documentation to find out how to the set the keys for this parameter.

Tim Bennett is a web designer and developer. He has a First Class Honours degree in Computing from Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.