This is an interesting idea. Set dir=auto in something like <main dir=auto> then use JS to cascade the value down. I guess dir=auto is not inherited by descendent elements.
Just to be clear… there is nothing to fix here. Hugo’s markdown renderer adheres to the CommonMark and GFM specification. You’d have to request a change to the specification, which will never happen.
Using markdown attributes makes sense to me… good thinking.
I do sites with RTL languages from time to time but have completely missed this possibility. Thanks for poining it out! I think I have a use case for it directly.