Hyphenation can be tuned via CSS but I have never been happy with it:
https://www.w3schools.com/cssref/css3_pr_word-break.asp
From what I remember LaTeX has better algorithms, both in how to distribute words between lines, and in knowing where in a word it is ok to cut.