Templates rendering removing prefix empty lines

The way I use /hr snippet is often inline. This doesn’t render:

---

This does:


---

This is fine as according to the markdown syntax, so I wanted to add prefix empty line, since without that, it doesn’t get render as a line.
(Sidenote: --- rendering is not consistent, as I have places where frontmatter works as if it was an empty preceding line, creating a horizontal line without a required blank line).
Sice it’s all about hacker mindset I decided to change the sinppet template to add extra blank line before and after --- since that’s how I use it.
Hovewer, all of the blank lines at the beginning of the template get removed when rendered (before the --- in my case), while all blank lines at the end of the template are kept. Is this a desired behavior?
To my personal taste, blank lines should be kept in both scenarios, for consistency and for ability to use whitespace lines for text formatting, but I guess some design decision might be lurking here as well.

So I ask, out of curiosity - is it by design?

(0.9.2, Arc, Safari, deno)