Took me about an hour but I think I found the source of the issue:
What's happening is that if a relative path is detected in a markdown url, this code checks that the relative path prefix is there. I'm not really sure why this is the case. If I'm running Wordpres (I am) and upload images there, shouldn't I be able to use relative URLs without enforcing the relative_path?
(For my reference, the relative path is set based on the site url)