Generally (in the context of line-wrapping) a period placed at the end of a word is associated as part of that word, which is why word+period is treated as a single unit. The same is true for other characters like the coma, colon, semi-colon, etc.
eg. The following Passage content.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et 12345 magna aliqua.
... gets converted into HTML like the following.
<div id="passage-untitled-passage" data-passage="Untitled Passage" class="passage">
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et 12345 magna aliqua."
</div>
... you will notice that the generated HTML consists of a parent div element with a single child HTML TextNode element containing the line of text.
note: To indicate that the line of text in the above is actually a HTML TextNode I have wrapped that line in double quotes, which is how the Web Developer tools built into your web-browser also generally represents a Text Node. These double quotes are not included/displayed within the visible output.
If we change that line of text to include Custom Styling like the following.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et 12345 magna @@aliqua@@.
... the generated HTML would look like the following.
<div id="passage-untitled-passage" data-passage="Untitled Passage" class="passage">
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et 12345 magna "
<span class="marked">aliqua</span>
"."
</div>
... and you will notice that the parent div element now has three children, two TextNodes and a span element. You will also notice that the period is no longer directly associated with the word aliqua, and this is possibly the cause of your issue if the web-browser code that handles line wrapping incorrectly dissociates the period and treats it as a single unit.
You didn't state what brand or version of web-browser you are using, what brand or version of operating system you're running that web-browsers on, not what type of device (desktop/mobile) you are using so I wasn't able to duplicate your environment.
I wasn't able to reproduce your issue with either Chrome or Firefox on Windows 10, but then again the issue may only occur for specific edge-cases and/or for particular combinations of web-browser / operating system / device.
I can only suggest placing the period inside the Custom Styling.