So I have found the answer to this!
The trick is to add this piece of code at the beginning of your text block, in the html.
<div dir="rtl" lang="ar">
And then all your text reads left to right, and the punctuation is in the right place. This also applies when you have tokens, which is great!