In Sphinx reST, you can't put spaces at the beginning or end of certain literals and similar things. I think this is more to help catch or avoid mistakes than a real technical requirement.
With three changes to the source code, you can apparently get around this restriction, but I have no idea if it always works or if it's safe, since I barely tested it and just messed around in the Sphinx code without knowing what I was doing.
Here are the details:
The following four literals are usually not allowed in Sphinx reST source because they start or end with a space:
abc `` def`` ghi third change
jkl ``mno `` pqr first change
stu :literal:` vwx` yza third change
bcd :literal:`efg ` hij second change
But if you make these three changes to the Sphinx "docutils/parsers/rst/states.py" file, it works (no guarantees, try it at your own risk!):