12

OSX's Quicklook renders HTML (with the plugin /System/Library/Quicklook/Web.qlgenerator). I'd like to see plain text, as if I'd renamed the .html as .txt (that's not a solution and not only because it's awkward: I'm hoping that if the HTML rendering is turned off the code-coloring Quicklook plugin I use will kick in, and Quicklook will show me pretty HTML code).

I haven't been able to turn off HTML without killing Quicklook html support, which is what happens when I remove the plugin. I don't really know what I'm looking at in info.plist, but removing the public.html line is just as bad.

Tips?

henry
  • 4,244
  • 2
  • 26
  • 37

1 Answers1

12

This question is related to: https://apple.stackexchange.com/questions/51816/quicklook-html-plugin.

Here is a solution that works (tested on Mac OS X 10.7.5):

  1. /install qlcolorcode (or qlstephen)

  2. Edit /System/Library/Quicklook/Web.qlgenerator/Contents/Info.plist and comment the two lines as below:

    <key>LSItemContentTypes</key>
    <array>
      <string>com.apple.webarchive</string>
      <!-- <string>public.html</string> -->
      <!-- <string>public.xhtml</string> -->
      <string>public.svg-image</string>
    </array>
    
  3. Add the two lines removed above under the same <key>LSItemContentTypes</key> into ~/Library/QuickLook/QLColorCode.qlgenerator/Contents/Info.plist (or ~/Library/QuickLook/QLStephen.qlgenerator/Contents/Info.plist)

  4. Press Command+Option+Esc and restart Finder.

Now QuickLook should display the source code of HTML files (with syntax highlighting if you use qlcolorcode) instead of rendering them.

Community
  • 1
  • 1
sdive
  • 2,047
  • 1
  • 20
  • 20
  • 4
    I didn't have to comment out the lines from `/System/Library/Quicklook/Web.qlgenerator/Contents/Info.plist`. Just adding them to `~/Library/QuickLook/QLStephen.qlgenerator/Contents/Info.plist` worked for me. – Himanshu P Apr 25 '13 at 09:52
  • On Mavericks, I found that it wasn't sufficient to comment out those lines in the `/System/Library/QuickLook/Web.qlgenerator/Contents/Info.plist`. The only way I could make it work with HTML files was to add those lines to the `QLColorCode.qlgenerator` file, while at the same time turning completely off the `Web.qlgenerator` – Phil Ryan Dec 03 '14 at 00:50
  • On Sierra I just had to add the 2 lines to: `~/Library/QuickLook/QLColorCode.qlgenerator/Contents/Info.plist` – TimM May 04 '17 at 10:20