From 466c98910bbe22a4a6a2fad87cc3b0baeed14555 Mon Sep 17 00:00:00 2001 From: Oleg Geier Date: Thu, 16 Jan 2020 13:48:04 +0100 Subject: [PATCH 1/2] Fix Thumbnail preview. Closes #88 --- GenerateThumbnailForURL.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GenerateThumbnailForURL.m b/GenerateThumbnailForURL.m index 7bea8da..15a3fd9 100644 --- a/GenerateThumbnailForURL.m +++ b/GenerateThumbnailForURL.m @@ -30,7 +30,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]; From 2c35b8333867f66d5292e80f4112ae8e329d7b25 Mon Sep 17 00:00:00 2001 From: Oleg Geier Date: Wed, 12 Feb 2020 13:17:00 +0100 Subject: [PATCH 2/2] Fix markdown rendering after #91 merge --- GenerateThumbnailForURL.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GenerateThumbnailForURL.m b/GenerateThumbnailForURL.m index 15a3fd9..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