diff --git a/GenerateThumbnailForURL.m b/GenerateThumbnailForURL.m index 7bea8da..fa2e315 100644 --- a/GenerateThumbnailForURL.m +++ b/GenerateThumbnailForURL.m @@ -5,6 +5,8 @@ #import #import +#import "markdown.h" + OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize); void CancelThumbnailGeneration(void *thisInterface, QLThumbnailRequestRef thumbnail); @@ -17,7 +19,7 @@ OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thum OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize) { - NSString *content = [NSString stringWithContentsOfURL:(__bridge NSURL *)url encoding:NSUTF8StringEncoding error:nil]; + NSString *content = renderMarkdown((__bridge NSURL *)url); if (content) { // Encapsulate the content of the .strings file in HTML @@ -30,7 +32,7 @@ OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thum // Create the webview to display the thumbnail WebView *_webView = [[WebView alloc] initWithFrame:_rect]; - [_webView scaleUnitSquareToSize:_scaleSize]; + [_webView.mainFrame.frameView scaleUnitSquareToSize:_scaleSize]; [_webView.mainFrame.frameView setAllowsScrolling:NO]; [_webView.mainFrame loadData:data MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:nil];