Paragraph tags surrounding shortcode are removed

I have a custom shortcode called button, which outputs a link. If I insert it into my HTML content file, and surround it with paragraph tags, the paragraph tags are stripped out in the output. For example, if my content file looks like this:

<p>{{< button >}}</p>

Hugo outputs this:

<a href="#"></a>

The surrounding <p> tags are stripped out. If I use % in my shortcode instead of angle brackets, the <p> tags are left intact. For example, with this content file:

<p>{{% button %}}</p>

Hugo outputs this:

<p><a href="#"></a></p>

I can’t find a documented explanation for this. Why is markup outside of the shortcode being affected in this way?