Proposal towards resolving Markdown ambiguity & supporting plurality
As discussed in %VG8tIpq... up to %tDOfQSu..., messages from latest Patchbay and Patchwork use a different Markdown variant than other SSB messages. At present, it is ambiguous which variant a recent post is written in, and this results in messages being rendered not as they were intended.
RFC 7763 and RFC 7764 discuss this as the problem of missing context for Markdown. They offer the solution that markdown data should have associated with it an identifier for which variant it uses, to provide the missing context, such as in the filename or content-type. They created a registry of some Markdown Variants and their ids. If SSB messages that use markdown include an appropriate variant id, we can resolve the ambiguity for new messages.
Latest Patchbay and Patchwork use ssb-markdown
v4.0.0 which implements what is closest to CommonMark, while previous versions of ssb-markdown
used ssb-marked
which implements what is closest to GFM. Manyverse uses remark
with plugins, with default configuration of GFM. Both CommonMark and GFM are in IANA's markdown variants registry. These SSB markdown implementations also have special handling of SSB ids, so I propose using the IANA identifiers prefixed by "SSB-" to indicate the variant has SSB extensions.
May I propose this change for Patchcore, Patchbay and Patchwork:
When publishing a message of type post
, add to the content
object a property "variant": "SSB-CommonMark"
.
When rendering messages, take the msg.value.content.variant
value and pass it in as an option named variant
in calls to ssb-markdown
.
ssb-markdown
at present would discard the variant option, but in future versions it could use it.
Would this be acceptable?
@mixmix @mmckegg @christianbundy #patchbay-dev #patchwork-dev #ssb-markdown