It’s my preference to avoid conflating opinion/preference with intentional action.
Is there anyplace where there’s some canonical guidance on the nuance of whitespace within html templates/partials/shortcodes, that is current and accurate?
THUS FAR, the main thing I’ve noticed is that there’s a WHOLE LOT of differing opinions on how to use whitespace and go-template-whitespace-chompers.
chomping whitespace can be problematic for a few different reasons, as I understand it.
if I have a few shortcodes…
one ends with a newline-whitespace,
we’ll call him… whitenoise-end.html
{{ /* layouts/shortcodes/whitenoise-end.html */ }}
{{ /* whitenoise-end. I'm noisy. What? */ }}
{{ /* pretend the following is literally " " and a CRLF */ }}
./n
and we’d invoke him in MD as:
{{< whitenoise-end >}}
and one begins with a chomp…
{{- $myName := "chompyMcShortcode" }}
{{ /* layouts/shortcodes/chompy-mc-shortcode.html */ }}
{{ /* I'm chompy. What? I'm a nervous eater. don't judge. */ }}
and he’d be invoked by
{{< chompy-mc-shortcode >}}
also, we have one that ends with a chomp…
{{ $myName := "greedyChompChomp" }}
{{ /* layouts/shortcodes/greedy-chomper.html */ }}
{{ /* I'm chompy.... You gonna eat that? I'm hungry */ -}}
identified as {{< greedy-chomper >}}
if, in a page, I have:
---
{{< whitenoise-end >}}
{{< chompy-mc-shortcode >}}
---
is the expectation that I would have, as the resultant html:
<hr>
.
<hr>
should behavior be different if it were invoked like:
---
{{< whitenoise-end >}}{{< chompy-mc-shortcode >}}
---
likewise, if I have:
---
{{< greedy-chomper >}}
{{< whitenoise-end >}}
---
or
---
{{< greedy-chomper >}}{{< whitenoise-end >}}
---
is the expectation that the resulting html should have:
<hr>
.
<hr>
because chompy-mc-shortcode / greedy-chomper aren’t supposed to be able to chomp beyond their boundaries?
or is chompy expected to be able to chomp until the end of the last html element or non-whitespace/newline?
another way of wording it:
Does whitespace ownership begin/end at instantiation of the thing doing the chomping? or the thing invoking the chomping-template?
Does a partial invoking other partials behave the same? or are there other governing rules?
this is sorta what I’m trying to find explanations on… as there’s a lot of moving pieces in play, and I’m not sure what EXPECTED behavior is… or where that expectation is expressed in clear english… y’know?
I got lost in a rabbithole of yakshavers looking at the hugo source code, and don’t think that’ll be much help for me right now…