From e15fd011467050c5dab2af805b64b699ebf170c5 Mon Sep 17 00:00:00 2001 From: sbarex Date: Fri, 11 Feb 2022 15:21:36 +0100 Subject: [PATCH] Bugfix. --- CHANGELOG.md | 5 +++++ QLMarkdown.xcodeproj/project.pbxproj | 16 ++++++++-------- QLMarkdown/Base.lproj/Main.storyboard | 5 +++++ QLMarkdown/ViewController.swift | 12 ++++++++++++ cmark-gfm/extensions/inlineimage.c | 2 +- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66e6454..fcddabf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog +### 1.0.12 (37) +Bugfix: +- Better procedure for install the command line tool. +- Fixed the bug that prevented the processing of html raw images when they are not inserted in a html block element. + ### 1.0.11 (36) New features: - Support for opening markdown files (by dragging the file onto the app icon) diff --git a/QLMarkdown.xcodeproj/project.pbxproj b/QLMarkdown.xcodeproj/project.pbxproj index 8f933af..538c6d2 100644 --- a/QLMarkdown.xcodeproj/project.pbxproj +++ b/QLMarkdown.xcodeproj/project.pbxproj @@ -1433,7 +1433,7 @@ CODE_SIGN_ENTITLEMENTS = QLExtension/QLExtension.entitlements; CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 36; + CURRENT_PROJECT_VERSION = 37; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; HEADER_SEARCH_PATHS = ( @@ -1453,7 +1453,7 @@ "$(BUILT_PRODUCTS_DIR)/libpcre2/lib", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.11; + MARKETING_VERSION = 1.0.12; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.QLMarkdown.QLExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1470,7 +1470,7 @@ CODE_SIGN_ENTITLEMENTS = QLExtension/QLExtension.entitlements; CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 36; + CURRENT_PROJECT_VERSION = 37; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; HEADER_SEARCH_PATHS = ( @@ -1490,7 +1490,7 @@ "$(BUILT_PRODUCTS_DIR)/libpcre2/lib", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.11; + MARKETING_VERSION = 1.0.12; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.QLMarkdown.QLExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1684,7 +1684,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 36; + CURRENT_PROJECT_VERSION = 37; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -1706,7 +1706,7 @@ "$(BUILT_PRODUCTS_DIR)/libpcre2/lib", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.11; + MARKETING_VERSION = 1.0.12; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.QLMarkdown; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1727,7 +1727,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 36; + CURRENT_PROJECT_VERSION = 37; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -1749,7 +1749,7 @@ "$(BUILT_PRODUCTS_DIR)/libpcre2/lib", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.11; + MARKETING_VERSION = 1.0.12; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.QLMarkdown; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/QLMarkdown/Base.lproj/Main.storyboard b/QLMarkdown/Base.lproj/Main.storyboard index 8938a33..5b933d5 100644 --- a/QLMarkdown/Base.lproj/Main.storyboard +++ b/QLMarkdown/Base.lproj/Main.storyboard @@ -95,6 +95,11 @@ + + + + + diff --git a/QLMarkdown/ViewController.swift b/QLMarkdown/ViewController.swift index 6402890..98cbe2b 100644 --- a/QLMarkdown/ViewController.swift +++ b/QLMarkdown/ViewController.swift @@ -667,6 +667,18 @@ class ViewController: NSViewController { } } + @IBAction func reloadMarkdown(_ sender: Any) { + guard let file = self.markdown_file else { + return + } + let prev_scroll = self.prev_scroll + self.openMarkdown(file: file) + self.prev_scroll = prev_scroll + if prev_scroll > 0 { + webView.evaluateJavaScript("document.documentElement.scrollTop = \(prev_scroll);") + } + } + @IBAction func exportPreview(_ sender: Any) { let savePanel = NSSavePanel() savePanel.canCreateDirectories = true diff --git a/cmark-gfm/extensions/inlineimage.c b/cmark-gfm/extensions/inlineimage.c index e0515fb..1c2d5de 100644 --- a/cmark-gfm/extensions/inlineimage.c +++ b/cmark-gfm/extensions/inlineimage.c @@ -185,7 +185,7 @@ static cmark_node *postprocess(cmark_syntax_extension *ext, cmark_parser *parser cmark_chunk_set_cstr(mem, &node->as.link.url, encoded); free(encoded); } - } else if (node->type == CMARK_NODE_HTML_BLOCK && html_callback != NULL) { + } else if ((node->type == CMARK_NODE_HTML_BLOCK || node->type == CMARK_NODE_HTML_INLINE) && html_callback != NULL) { // Search inside the raw html fragment and process the images. cmark_chunk_to_cstr(parser->mem, &node->as.literal); unsigned char *s = NULL;