and my content/en/my-page/index.md contains this markdown  and my content/de/my-page/index.md also contains the same image: .
Now what I was expecting was that hugo’s lookup order for bundled pages would first look in the localized page-bundle for de for my-image.png, not find it, then look in the global /static/images, also not find it, then look in the en page bundle, find the image and render the something like the following the resulting html: <img src="/big/long/link/to/english/myimage.png">
But that’s not what’s happening for me in hugo (0.139.4) on my site. I bisected back a few versions of hugo and it seems it’s been that way for awhile.
Before I dig in and debug more, I wanted to ask: is my expectation incorrect?
If you have either markup.renderHooks.image.enableDefault=true or have a custom image render hook that’s looking for the image in the bundle resources, the answer to your question is yes.
Agreed. The repo in question above is private, but I went to reproduce this issue for you with a public repo that shares the same theme and…I failed. That site behaves as expected. I guess I need to compare the settings of each site to see what is different.
But how would you have known to do that?
How would a theme author know not to use markdownify in a div shortcode?
On several occasions I have unsuccessfully advocated for the deprecation of the markdownify function in favor of the RenderString method. Yes, the ability convert a string of Markdown to HTML without having a page reference is handy, but you need to think carefully about what you’re doing. If you don’t, the rendered page may be incorrect without warning or error, and the problem can be difficult to track down.
My guidance is to always use the RenderString method.