How to use MD filter without <p> generation

¿How can I use the MD filter without the automatic <p> container?

<label class="control-label"> {{ variable | md }} </label>

generates

<label class="control-label"> <p>the <strong>value</strong> displayed</p> </label>

The automatic <p> tag is not always necessary. In this case I just need the

<label class="control-label"> the <strong>value</strong> displayed </label>

Thanks

can you please paste your MD code, because this <p> was probably created because you have content on second line instead of first. i had never seen any leading paragraph when has only one line sentence in first line.

You can create your own filter like this.

public function registerMarkupTags()
{
  return [
    'filters' => [
         'md_inline' => function($str) {
            return \Markdown::parseLine($str);
         }
     ]
  ];
}
2 Likes