Hello! I haven't fully implemented this yet (I just started learning Japanese myself, so I see the importance of this) and while better text rag is planned for STM someday, I won't be able to get that in urgently.
So! As a quick workaround, here's two steps to follow:
First, inside of SuperTextMesh.cs, there's a variable named "linebreakFriendlyChars" declared on line 1106 change that line to this:
private char[] linebreakFriendlyChars = new char[]{' ', '\n', '\t', '-', '\u00AD', '\u200A', '\u200B', '。', '〜', '、', ',', '…', '‥'};
This will allow STM to insert automatic linebreaks at Japanese punctuation, if it's available.
Unfortunately, this doesn't solve the above circumstance where no punctuation happens before the first line break, so the second thing to do is utilize zero-width spaces! They're easy to lose track of, so you can use the tag <u=200B> in STM to insert a zero-width space in a spot where a linebreak is safe to perform. You could also just manually insert a line break with <br> if you want a line break to happen for sure at a certain location.
In the future, I'd love to have STM be able to tell where Japanese words start and stop, but without spaces it's a bit of a challenge... I'd probably have to implement a dictionary function! I'm going to write this down, I think I just thought of a way to make this happen in the future... but for an urgent problem, the above solution will work! The idea I had was... if I implement a dictionary, I could have STM automatically put a zero-width space between every character... but in reality, it'd probably be better to have a script like this run on your entire game's script before it even gets to STM, so a dictionary doesn't need to be parsed every time STM needs to rebuild... Is it possible to run a method like that on your game's script?
Sorry that last paragraph is a bit rambling! I really should be asleep, but I hope this helps!