First a little context! In many East Asian languages, a technique is used to make it easier to read characters that people might not recgonise. For example, the Japanse word for tea is pronounced “ocha”. It contains a kanji character and to help people learn, the phentic is written above it.
I just tested this in a normal Japanese markdown page in Hugo, and it renders fine as is. I just pasted in the <ruby>茶<rp>(</rp><rt>ちゃ</rt><rp>)</rp><ruby> like a span, to test, and it works fine mixed in there. It did not appear to disrupt the markdown processing.
Edit: one thing that does not look good is, when you mix in a kanji character like this to English, the line height is effected and the page looks kind of messy. Adding ruby makes it worse. On an all-Japanese page, it’s probably not as much of a problem.
Yeah it has its downfalls when you’re making a page that’s in English, such as when you’re teaching Japanese – but I guess that’s fairly niche and can be negated. When I’ve used that, I tend to separate them in blocks rather that doing it in-line. If you’re teaching kanji on a Japanese page then I guess it’s probably more reasonable.
Good point that it works well with just the HTML! I think I’d just assumed it would be messy without even trying, but it’s not so bad looking at it.