samuelmeuli / glance

🔎 All-in-one Quick Look plugin
MIT License
963 stars 68 forks source link

Markdown (.md file) is still not rendered #17

Closed Stramon1um closed 4 years ago

Stramon1um commented 4 years ago

Hi, I just installed the new update but still my .md files are not rendered whereas the rest is super fine and rendered.

Schermata 2020-05-19 alle 16 15 15
karkraeg commented 4 years ago

Same here. I ran mdls -name kMDItemContentType -name kMDItemContentTypeTree Test.md

and the Output is strange:

kMDItemContentType     = "com.unknown.md"
kMDItemContentTypeTree = (
    "com.unknown.md",
    "public.text",
    "public.data",
    "public.item",
    "public.content",
    "public.plain-text"
)

I actually face the same problem described here: https://apple.stackexchange.com/questions/384328/why-does-the-kind-column-show-the-chinese-characters-%E6%96%87%E4%BB%B6-for-markdown-files and I looked into /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump as to who registered the UID com.unknown.md and it seems to be TeXShop... I changed MD Files to be opened with VSCode, Typora, Mark Text - restarted, cleared LaunchServices Cache and so on, still no luck.

karkraeg commented 4 years ago

... when I change a files extension to *.markdown Glance works and kMDItemContentType returns "net.daringfireball.markdown"

Stramon1um commented 4 years ago

yes, with .markdown it works fine, only not with .md

samuelmeuli commented 4 years ago

It's a shame that not all apps use the official Markdown UTI. @karkraeg, I'll add yours (com.unknown.md) in the next version. If anybody else uses an app with a different UTI, let me know and I'll add it as well.

samuelmeuli commented 4 years ago

@Stramon1um I'm not sure why it's not working for you. Pasting your mdls output from Reddit:

kMDItemContentType = "net.daringfireball.markdown"
kMDItemContentTypeTree = (
    "net.daringfireball.markdown",
    "public.text",
    "public.data",
    "public.item",
    "public.content"
)

You're getting the correct UTI, which is supported by Glance. It's weird that macOS doesn't use the plugin.

Stramon1um commented 4 years ago

I re run the command you suggest on reddit mdls -name kMDItemContentType -name kMDItemContentTypeTree

and here the results

kMDItemContentType     = "net.daringfireball.markdown"
kMDItemContentTypeTree = (
    "net.daringfireball.markdown",
    "public.plain-text",
    "public.text",
    "public.data",
    "public.item",
    "public.content"
)

I just noticed that now I have an extra line compared to before the update "public.plain-text"

I thought that I could be helpful for you

kikker902 commented 4 years ago

Markdown rendering works till I install iA writer. Strange...

samuelmeuli commented 4 years ago

@kikker902 Could you please run mdls -name kMDItemContentType -name kMDItemContentTypeTree /path/to/your/file.md with iA Writer installed?

kikker902 commented 4 years ago

When I run mdls -name kMDItemContentType -name kMDItemContentTypeTree I get this result with iA Writer installed.

kMDItemContentType     = "net.ia.markdown"
kMDItemContentTypeTree = (
    "net.ia.markdown",
    "public.plain-text",
    "public.text",
    "public.data",
    "public.item",
    "public.content"
)
samuelmeuli commented 4 years ago

Added, the next release should fix this for you.

Stramon1um commented 4 years ago

yeap, after installing the last update it works super fine now! Thanks