Markdown reader:  inline math must have nonspace before final `$`.

Closes #1313.