Allowing Markdown Cross-Flavor Compatibility

(I’m n00 and coming at this cold for reasons explained below. If I’ve made a faux pas or referenced something incorrectly, please let me know.)

As a pretty frequent redditor, it’s become more and more apparent that the Apple/Swift-Markdown renderer, while fine in silos, fails to render input as intended when provided external content from sources that adhere to a non-GitHub Markdown spec. I’d like to suggest considering a remedy.

My specific motivation is that I love to end sentences with italicized exclamation points — like this*!* — just for fun, of course. These render just fine on both old- and new Reddit in the browser.

But since the Apple/Swift-Markdown renderer spec (assuming I’ve found the correct document) specifically requires either whitespace or punctuation before an asterisk-punctuation sequence in order to start an emphasized sequence, my exclamation points come out escaped like this*!*. That’s just one example. The Reddit browser I use on my iPhone and iPad is Apollo for Reddit, and there are posts over on the r/ApolloApp subreddit pretty frequently from users who find something or other that doesn’t render quite right in the app.

Christian, the lone dev, has mentioned a few times that he uses Apple/Swift-Markdown to interpret the Markdown code, which implies that this isn’t something he can just fix/change on his own. The fact that the issue seems not limited to myself seems to imply that it’s probably happening elsewhere too — in other apps interacting with services that follow yet other markdown standards.

So I researched the hell out of this and found my way here to suggest considering making the renderer agnostic with respect to Markdown flavor, to provide a way of telling Apple/Swift-Markdown which set of rules to use when parsing the plain text.

And I was hoping that you might agree.

Welcome to the forums! I don’t work on the markdown library but I can tell you I had a similar experience with the gitlab parsing library. My use case was markdown table formats. In your use case it seems like the developer has chosen this library and probably it’s not going to add a different library to accommodate other flavors. If the Reddit client is open source perhaps you can fork it and replace the markdown flavored library of your choice.

I’ll be honest with you. It’s unlikely that folks will implement multi flavors of markdown.