Deliver as markdown, but with a single line header:
<!DOCTYPE html><title>Foo</title><script src=mydelayedmarkdownparser.js></script><PLAINTEXT>
[[insert your markdown here]]
A document delivered as pure markdown, that will get spidered by any search engine that renders JavaScript (or that reads the document as text), and you don’t need to ask anyone to change anything. HTML has no closing </plaintext> end tag, so markdown can be free-form and securely include any unescaped <>”’ characters (raw HTML code) you need into your markdown and the browser will treat it as pure text (unlike the <XMP> tag which can be ended with </XMP> - even weirder lexing).
The key is that although the <plaintext> tag is deprecated, every browser has to support it (partially because removing support for <plaintext> would cause security issues for existing pages!) The <plaintext> tag is really very special, quite different from any other tag, and it radically interrupts HTML document lexing/parsing.
What is needing then, is adding the "type" attribute in <plaintext> command, that browsers with their own implementation can optionally use it instead in order to render with the user's settings if desired.
However, that still forces you to serve HTML, so it is not good. My idea is adding a "Interpreter" response header, which indicates which files can be used to render files (documents, audio, video, pictures, etc) that the client implementation does not understand already. The end user can also specify their own overrides, if desired.
Fun related fact people may not be aware of: you can do basically this with arbitrary XML files, defining a stylesheet which transforms the XML into HTML however you like using XSLT. As an example, Atom feeds on my website (such as <https://chrismorgan.info/blog/tags/meta/feed.xml>) render just fine in all mainstream browsers, thanks to this processing instruction at the start of the file:
(Mind you, XML is hard to work with in browsers, because it’s been only minimally maintained for the last twenty or so years. Error handling is atrocious (e.g. largely not giving you any stack trace or equivalent, or emitting errors only to stdout), documentation is lousy, some features you’d have expected from what the specs say are simply unsupported, and there are behavioural bugs all over the place, e.g. in Firefox loading any of my feeds that also fetch resources from other origins will occasionally just hang, and you’ll have to reload the page to get it to render; and if you reload the page, you’ll have to close and reopen the dev tools for them to continue working.)
The key is that although the <plaintext> tag is deprecated, every browser has to support it (partially because removing support for <plaintext> would cause security issues for existing pages!) The <plaintext> tag is really very special, quite different from any other tag, and it radically interrupts HTML document lexing/parsing.
Use something like https://whatismarkdown.com/how-to-have-markdown-in-realtime-... to read the content of the <plaintext> and dynamically render your markdown into HTML.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pl...
Edit: and of course there is the HTTP header Content-Type: text/markdown which could be used by browsers to render a markdown document - see “The text/markdown Media Type” RFC https://www.rfc-editor.org/rfc/rfc7763.html and https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Co...