Em-dash being placed after line break instead of before

When I use an em-dash (—) near the end of a line, and LibreOffice breaks the line around the em-dash, the dash gets placed after the line break, at the beginning of the new line. Of course, the dash should be placed before the line break, at the end of the previous line. What the heck is going on? Is there a setting I can change to make this behave properly?

Thanks!

Line break depends on word length unless hyphenation is on (is it your case?). In my experiment, em-dash gets placed at the end of the line or beginning of next according to size of preceding word.

Is there a typographic rule in your locale language requiring em-dash to be placed at start of line?