markoff: Markoff cannot open files in the "Plain Text" format

To be honest, I just find this kind of amusing!

capture 2016-03-01 at 10 47 14 am

¯_(ツ)_/¯

Any files with the extension .txt are greyed-out in the file chooser, and I got this error using open -a Markoff foo.txt.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I could help take a look at this. As-is if I (for example) try to drag an image while allowing any file, it shows an appropriate warning (unable to parse the file).

To be more fancy you could tweak the CFBundleDocumentTypes entry to allow other extensions (pretty much any text extension might be acceptable; plain text is valid markdown for the most part).

I notice right now the existing entry uses CFBundleTypeOSTypes which is, while not officially deprecated, not all that useful for modern text files, especially in that it’s allowing ???. Types and creators have been deprecated since 10.6 and are no longer even considered on the current deployment target.

The “modern” replacement is LSItemContentTypes which uses UTI’s instead of type-creator codes.

Then it’s a decision on which UTI’s to support. Using public.txt should be almost automatic. There’s still the problem of the markdown engine trying to parse non-markdown, but again, that’s not a bad thing. Most plain text will render just fine. Some of the other system defined UTIs might be candidates, too.

John Gruber has even indicated a preferred UTI for Markdown (UTIs aren’t limited to Apple’s system UTIs).

net.daringfireball.markdown, which conforms to public.plain-text. The encoding should always be UTF-8.

So there’s good support for arguing public.plain-text in addition to public.txt that I mentioned.