@taschenorakel Technically not a real problem. An ActivityPub message contains raw and rendered (as HTML). Other clients happily convert markdown in raw to the equivalent HTML in rendered, which is why you see those nicely formatted toots also here. Mastodon has no problem in giving you the rendered in a toot, but it won't do anything with the raw itself :(
@taschenorakel But it would be weird to be able to use markdown in a client but not in the browser. I really don't understand why this is such a big problem. @MastodonEngineering
@jwildeboer In short: it requires a refactor of the whole message parsing & generation code. AP messages are HTML, so you need to transform this Markdown to HTML, safely and efficiently. But if the user then wants to edit their post, you need to show them the Markdown again.
Glitch SOC does it in a problematic way, and we explored alternatives without (yet) figuring out an obvious path for having it in Mastodon.
@renchap So is it a problem in the AP standard where @evan and friends might be able to help? @taschenorakel
@renchap I can easily believe that's difficult! It took Wikimedia some 13 years to make #MediaWiki's wikitext-HTML parser bidirectionally lossless [I simplify]... https://www.mediawiki.org/wiki/Parsoid
So you simply limit the supported Markdown to a subset that's recoverable from HTML without loss. Additionally you could embed helpful information using HTML5 attributes or XML namespaces.
But actually: Unless you permit really fancy stuff, converting forward and back isn't that hard. The original Markdown.pl was just a handful regular expressions wrapped in plenty of comments and a little bit of Perl.
@renchap Not really that complex, IMHO. You could happily use (limited) markdown internally and only convert to html when federating. Note that using the internal representation is only needed when editing an existing message. I don’t see any case where a mastodon instance has to convert back and forth for messages received through federation. @taschenorakel
@jwildeboer I don’t know what more I can say. We spent some time on this and did not (yet) find a good solution. If you think this is trivial and we are missing something, I would be glad to approve your Pull Request implementing it.
@nemobis Luckily we do not plan to support very complex syntax, but this is still non trivial
@jwildeboer It does not have anything to do with ActivityPub, but with Mastodon's internals