QuartoNotebookRunner.jl icon indicating copy to clipboard operation
QuartoNotebookRunner.jl copied to clipboard

Ignore html MIME type for Julia's markdown

Open jkrumbiegel opened this issue 1 year ago • 4 comments

It's pretty annoying that standard md"some markdown" objects have the text/html MIME type defined because this will be preferred by quarto as a "higher" MIME type, even though as it's a markdown based format that doesn't really make sense. I think it's really common that people want to splice in parts of markdown into a document, and it's just confusing if that partially breaks because of intermediate HTML conversion. Especially if the markdown contains syntax specifically meant for quarto/pandoc postprocessing.

So my proposal is to special case just Julia's included markdown type Markdown.MD and ignore its html MIME type. The only other alternative is for every user to define or load from some other package a separate markdown object which doesn't have html conversion defined.

jkrumbiegel avatar Apr 26 '24 10:04 jkrumbiegel

Would ignoring text/html, if there is text/markdown available, be sufficient? Instead of doing some special casing of types.

MichaelHatherly avatar Apr 26 '24 10:04 MichaelHatherly

I guess so, but usually html would be richer than markdown (let's say for table packages that define both). I'm just arguing that if you specifically constructed a Markdown object, it seems sensible to use that.

jkrumbiegel avatar Apr 26 '24 11:04 jkrumbiegel

Another issue that does impact this somewhat. Markdown stdlib implements a flavour of markdown that isn't quite the same as markdown pandoc uses, so just using the text/markdown will likely result in incorrect rendering in some cases unfortunately.

MichaelHatherly avatar May 22 '24 07:05 MichaelHatherly

Ah I didn't consider markdown flavors, I guess the mimetype doesn't reflect the flavor used. I guess people can still go the route where they print to stdout instead of letting markdown objects be rendered via display system, although it's not as straightforward.

jkrumbiegel avatar May 22 '24 07:05 jkrumbiegel

I don't think there's much we can really do here @jkrumbiegel.

MichaelHatherly avatar Jul 18 '24 12:07 MichaelHatherly