Mediawiki's rendered wikitext will never break a line just before a footnote. VisualEditor will break lines just before a footnote, even if the symbol right before the footnote is a period. The behaviors of VisualEditor and MediaWiki should be consistent.
For an example, go to
https://www.mediawiki.org/w/index.php?title=VisualEditor:TestAxelBoldt&oldid=1656089&veaction=edit
and adjust the browser window's width until the line break occurs just before footnote [1].