exerslide icon indicating copy to clipboard operation
exerslide copied to clipboard

Unknown content type "text_markdown"

Open kwangkim opened this issue 7 years ago • 2 comments

For all md files, I received

 Unknown content type "text_markdown"

For each file, I need to add

content_type: text/x-markdown

I think this error came from mime-types library since lookup function only return text/markdown not text/x-markdown. https://github.com/jshttp/mime-types#mimelookuppath

I could fix this by putting https://github.com/kwangkim/exerslide/blob/610cdc7f70e5a6d8ed526220c3b2cbe19450fb1b/packages/exerslide/lib/slide_transforms/registerContentType.js#L45

        if (contentType === "text_markdown"){
          contentType = "text\/x-markdown"
        }

P.S. https://github.com/jshttp/mime-db/blob/66588fec459c0d61cec5c69cfd161b139f75cf7d/db.json#L6561

Another resolution was using 'mkd' instead 'md'.

kwangkim avatar Aug 30 '17 06:08 kwangkim

Sorry I have not seen this issue. Markdown wasn't a standard mime type, so text/x-markdown was returned. I guess it has changed since then?

The correct (but not so pretty way) would be to create a new file here: https://github.com/facebookincubator/exerslide/tree/785e240a60139f5788558cfae65b01a69dc03184/packages/exerslide-plugin-markdown-converter/contentTypes with name text_markdown.js that simple exports the same functions as text_x-markdown.js.

Would you want to provide a PR for that?

fkling avatar Sep 14 '17 22:09 fkling

Your contribution page does not explain how to test locally. Definitely,

npm test

does not work.

npm install

does not seem to install all packages for each package. Could you give me a little more information?

kwangkim avatar Sep 16 '17 23:09 kwangkim