Markdown: Relative paths in preview (#1028)

Fixes #1028.

Also fixes #1029.