This issue is faced by many users, not only with Onmt but any MT system.
Some people tried to work around it, search for M4LOC.
Anyway, there are only 2 ways of trying to fix this:
Either you consider tags as regular tokens, and you trust the NN to learn properly how to plae them around some inline sub-segments, or you have to handle tags with rules BEFORE (ie prrepocessing) and AFTER (post processing).
Either way is not 100% accurate or perfect. you have to decide, and to do some homework.
But this cannot really be handled at the ONMT level.