The browser still needs to recognize it as text/html. I use Markdeep (https://casual-effects.com/markdeep/) and to get Chrome to auto-render locally I need to hard link to a name with a .html extension.
Also, it doesn't technically need to be a preamble. Markdeep works by appending similar code to the end, which is much more innocuous when viewing the file outside a browser or when its rendered by other software (e.g. on Github).
> Markdeep works by appending similar code to the end, which is much more innocuous when viewing the file outside a browser or when its rendered by other software (e.g. on Github).
Thank you for highlighting this feature of Markdeep. I have now added this feature in TeXMe and MdMe too. We can now put the `<script>` tag to load TeXMe or MdMe at the end of content. Here is an example:
# Euler's Identity
In mathematics, **Euler's identity** is the equality
$$ e^{i \pi} + 1 = 0. $$
<script src="https://cdn.jsdelivr.net/npm/texme"></script>
However, like I have explained in another comment[1], this method of writing content requires the content to not have any HTML syntax errors, otherwise the output would be mangled. Markdeep has this limitation too. There is a 'Caveats' section[2] in the README now that discusses this in detail.
The original method of writing content with a single line of HTML code at the beginning of the content does not have this limitation. But if the HTML code in the beginning feels distracting, we can now put the `<script>` tag in the end too.
> Also, it doesn't technically need to be a preamble.
For the kind of user input (e.g., code pasted verbatim) I was trying to handle, a preamble was technically necessary, at least a `<textarea>` start tag was necessary at the beginning of the document.
Also, it doesn't technically need to be a preamble. Markdeep works by appending similar code to the end, which is much more innocuous when viewing the file outside a browser or when its rendered by other software (e.g. on Github).