'Auto set classes in Parsedown PHP

I am using Parsedown (I also have Parsedown Extra and Parsedown Extra Plugin) to convert Markdown text to HTML. Do you know how I can set up automatic classes for specific HTML elements, e.g. I want every text that is p or h1 element to automatically have specific CSS classes appended?

So far, I only found information on how to set something like this once, namely by writing as markdown: "sample text {.class}".



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source