How to Convert CMS page content to html interpretation in Magento 2?

We can convert CMS page content into HTML specific format using native Magento class.

We need to use, \Magento\Cms\Model\Template\FilterProvider class to filter page content in the template file.
In PHP file,

public function __construct(
    \Magento\Cms\Model\Template\FilterProvider $filter
) {
    $this->filter = $filter;
* Page content $content
public function getContentFromPage($content)
    return $this->filter->getPageFilter()->filter($content);

Call from template file,

echo $this->getContentFromPage($content);