Accessing the stack of shortcodes/hooks processing an element

Is it possible to know from a shortcode or renderhook, the list of shortcode (in order) the content at hand has been through ? I know the .HasShortcode function but its much too broad, I want a list of ancestor shortcodes, and custom attribute classes.
Probably (certainly) not changing much if anything to load times, but something I would love it !

https://gohugo.io/templates/shortcode-templates/#access-parameters

.Parent and .Name

1 Like

Thanks, I had read but not understood what it meant.
But how do I use it ? There’s no example whatsoever
I added {{with .Parent}}{{warnf "v%" .Destination}}{{end}} above my link hook and it outputs:

Error: Error building site: “/home/drm/WEBSITE/content/docs/Love/homo_nazi_en.md:1:1”: “/home/drm/WEBSITE/themes/hugo-book/layouts/_default/_markup/render-image.html:1:7”: execute of template failed: template: _default/_markup/render-image.html:1:7: executing “_default/_markup/render-image.html” at <.Parent>: can’t evaluate field Parent in type goldmark.imageLinkContext

And It’s a shortcode variable, nowhere is it said it would work in renderhooks, so it might be useless here, might it not ?

The documentation link that I provided is about shortcodes.
The methods described on that page are available within shortcodes.

Yes so it wouldn’t work for me. I know I wrote “shortcode or renderhook” but it’s actually only the second, I just didn’t suppose there was so much difference, because intuitively there shouldn’t be any.
So, too bad I guess