Giter Club home page Giter Club logo

qlmarkdown's Introduction

counter counter

logo

QLMarkdown

QLMarkdown is a macOS Quick Look extension to preview Markdown files.

This application is not intended to be used as a standalone markdown file editor or viewer.

Please note that this software is provided "as is", without any warranty of any kind.

The Quick Look extension can also preview rmarkdown (.rmd) files (without evaluating r code), Quarto files (.qmd) and textbundle packages.

You can download the last compiled release (as universal binary) from this link.

Screenshots

Quick Look Markdown preview

main interface

Installation

You can download the last compiled release (as universal binary) from this link or you can install the Application with Homebrew:

brew install --cask qlmarkdown

The precompiled app is not notarized or signed, so the first time you run the app the system may show a warning about the impossibility to check for malicious software.

To fix, you can launch the app with right click (or ctrl click) on the app icon and choose the open action.

You can also execute this command from the terminal:

$ xattr -r -d com.apple.quarantine "FULL PATH OF THE QLMarkdown.app (you can drag the file to get the pull path)"

Alternatively, after trying to launch the app for the first time, you can open the System Preferences > Security & Privacy > General (tab) and click the Open Anyway button.

This will resolve the error of an unsigned application when launching the app.

To use the Quick Look preview you must launch the application at least once. In this way the Quick Look extension will be discovered by the system. After the first execution, the Quick Look extension will be available (and enabled) among those present in the System preferences/Extensions.

If you have problems, try moving the application to the trash and then back in the Applications folder. If the QLMarkdown Preview Extension is present (and checked) in the list of Quick Look Extensions in the System preferences but the .md files are not displayed it is probably due to other applications that have registered support for that type of file. You can change the order of priority of the Quick Look Extensions inside the System preferences.

Finally, the problems may depend on how the .md files were registered on the system by other applications.

In the terminal try the following command:

mdls -name kMDItemContentType PATH_OF_AN_EXISTS_MD_FILE

The output is the UTI associated with the .md file.

This application handle these UTIs:

  • com.rstudio.rmarkdown
  • com.unknown.md
  • net.daringfireball.markdown
  • net.ia.markdown
  • org.quarto.qmarkdown
  • public.markdown
  • org.textbundle.package
  • dyn.ah62d4rv4ge8043a (dynamic UTI for unassociated .md files)
  • dyn.ah62d4rv4ge81e5pe (dynamic UTI for unassociated .rmd files)
  • dyn.ah62d4rv4ge81c5pe (dynamic UTI for unassociated .qmd files)

Please inform me of any other UTI associated to .md files.

Markdown processing

For maximum compatibility with the Markdown format, the cmark-gfm library is used. The library is a GitHub fork of the standard cmark tool to process the Markdown files.

Compared to the cmark-gfm, these extensions have been added:

  • Emoji: translate the emoji placeholders like :smile: to ๐Ÿ˜„.
  • Heads anchors: create anchors for the heads.
  • Inline local images: embed the image files inside the formatted output (required for the Quick Look preview).
  • Math: format the mathematical expressions.
  • Syntax highlighting: highlight the code inside fenced block.
  • YAML header: render the yaml header at the begin of rmd or qmd files.

Difference with the GitHub Markdown engine

Although GitHub has customized the cmark-gfm library, it does not use it directly in the rendering process of Markdown files (see this repository). GitHub uses a number of libraries in Ruby for parsing and formatting source code that cannot easily be converted into a compiled library.

The main difference between this application and GitHub is the formatting of the source code. Syntax highlighting uses a different library, so the formatting, colors scheme, and language token recognition are potentially different.

This application, when set to use the accurate engine for the language detection (used only when the language is not specified) uses a library derived from the Linguistic framework adopted by GitHub.

Settings

Launching the application, you can configure the options, enable the desired extensions and set the theme for formatting the Quick Look preview of Markdown files.

To make the settings effective you need to save them (cmd-s or menu File > Save settings) or enable the autosave option.

main interface

The window interface has an inline editor to test the settings with a markdown file. You can open a custom markdown file and export the edited source code.

Please note that this application is not intended to be used as a standalone markdown file editor or viewer but only to set Quick Look preview formatting preferences. No warning about unsaved markdown code is displayed when closing the application.

Themes

You can choose a CSS theme to render the Markdown file. The application is provided with a predefined theme derived from the GitHub style valid both for light and dark appearance.

You can also use a style to extend the standard theme or to override it. User customized style sheet must have the settings for both light and dark appearance using the CSS media query:

@media (prefers-color-scheme: dark) { 
    /* โ€ฆ */ 
}

The custom style is appended after the CSS used for the highlight the source code. In this way you can customize also the style of the syntax highlight.

Syntax highlighting extension allow to customize the appearance of the code blocks.

The theme popup menu has some extra commands available pressing the alt key.

Options

Option Description
Smart quotes Convert straight quotes to curly, --- to em dashes and -- to en dashes.
Footnotes Parse the footnotes. Footnotes are not supported by GitHub.
Hard break Render softbreak elements as hard line breaks.
No soft break Render softbreak elements as spaces.
Inline HTML (unsafe) Render raw HTML and unsafe links (javascript:, vbscript:, file: and data:, except for image/png, image/gif, image/jpeg, or image/webp mime types) present in the Markdown file. By default, HTML tags are stripped and unsafe links are replaced by empty strings. This option is required for preview SVG images.
Validate UTF Validate UTF-8 in the input before parsing, replacing illegal sequences with the standard replacement character (U+FFFD ๏ฟฝ).
Show debug info Insert in the output some debug information.
Render as source code Show the plain text file (raw version) instead of the formatted output. Syntax highlighting remains.

Extensions

Extension Description
Autolink Automatically translate URL to link and parse email addresses.
Emoji Enable the Emoji extension.
GitHub mentions Translate mentions to link to the GitHub account.
Heads anchors Create anchors for the heads to use as cross internal reference. Each anchor is named with the lowercased caption, stripped of any punctuation marks (except the dash) and spaces replaced with dash (-). UTF8 character encoding is supported.
Inline local images Enable the Inline local images extension.
Math Enable the formatting of math expressions.
Strikethrough Strikethrough text inside tildes. You can choose to detect single or double tilde delimiters.
Syntax highlighting Enable the Syntax highlighting extension.
Table Parse table as defined by the GitHub extension to the standard Markdown language.
Tag filter Strip potentially dangerous HTML tags (<title>, <textarea>, <style>, <xmp>, <iframe>, <noembed>, <noframes>, <script>, <plaintext>). It only takes effect if the option to include HTML code is enabled.
Task list Parse task list as defined by the GitHub extension to the standard Markdown language.
YAML header Enable the YAML header extension.

Tou can also choose if open external link inside the Quick Look preview window or in the default browser.

The Quick Look window option allow you to force a custom size for the content area of the Quick Look window. Use with caution on macOS before version 12 Monterey.

Emoji

You can enable the Emoji extension to handle the placeholders defined by GitHub. You can render the emoji with an emoticon glyph or using the image provided by GitHub (internet connection required).

Multibyte emoji are supported, so :it: equivalent to the code \u1f1ee\u1f1f9 must be rendered as the Italian flag ๐Ÿ‡ฎ๐Ÿ‡น.

Some emoji do not have an equivalent glyph on the standard font and will be replaced always with the relative image.

A list of GitHub emoji placeholder is available here.

Inline local images

You can enable the Inline image extension required to preview images within the Quick Look window by injecting the images into the HTML code. The Quick Look extension, for security limitations, cannot access to the local images defined inside the Markdown code, so embedding the data it's a way around the limitation.

For security reasons are handled only URLs without schema (e.g., ./image.jpg, image.jpg or assets/image.jpg), or with the file schema (e.g., file:///Users/username/Documents/image.jpg) referring to existing files with an image mime type. With the file:// schema you must always set the full path. For images inside the same folder of the Markdown file do not use the file:// schema and also the path ./ is optional.

The extension process both images defined in the Markdown syntax and also with HTML <img> tag if the raw HTML code option is enabled.

Mathematical expressions

This extension allow to format the mathematical expressions using the LaTeX syntax like GitHub. Math rendering capability uses MathJax display engine.

Inline math expressions are delimited with a dollar symbol $. Block expressions are delimited with a double dollar symbols $$.

Alternatively, you can use the ```math code block syntax to display a math expression as a block.

The MathJax library is loaded from cdn.jsdelivr.net. The library is loaded if the markdown code contains ```math code blocks or one or more dollar sign.

Syntax Highlighting

This extension highlights the source code inside a fenced box.

The rendering engine is based on the Highlight library embedded in the app.

syntax highlighting settings

You can customize the settings:

  • Colors scheme (for light and dark appearance).
  • Line numbers visibility.
  • Word wrap options.
  • Tabs replacements.
  • Font.
  • Guess engine for undefined languages.

Some colors scheme (especially those for light appearance) uses a white background that is the same of the Markdown document, making the code block not immediately recognizable. For this reason, it is possible to override the background color in order to use a personal one or the one defined by the Markdown theme.

When the code block does not specify the language, it is possible to activate a guessing function. Two engines are available:

  • Simple guess: it is based on the magic library;
  • Accurate guess: it is based on the Enry library, that is a Golang porting of the Ruby linguist library used by GitHub.

If no language is defined and the guessing fail (or is not enabled), the code is rendered as normal text.

YAML header

You can enable the extension to handle a yaml header at the beginning of a file. You can choose to enable the extensions to all .md files or only for .rmd and .qmd files.

The header is recognized only if the file start with ---. The yaml block must be closed with --- or with ....

When the table extension is enabled, the header is rendered as a table, otherwise as a block of code. Nested tables are supported.

Command line interface

A qlmarkdown_cli command line interface (CLI) is available to perform batch conversion of markdown files.

The tool is located inside the QLMarkdown.app/Contents/Resources folder (and should not be moved outside).

From the Application menu you can create a symbolic link into /usr/local/bin folder.

Usage: qlmarkdown_cli [-o <file|dir>] <file> [..]

Arguments:
 -h    Show this help and exit.
 -o    <file|dir> Destination output. If you pass a directory, a new file is 
       created with the name of the processed source with html extension. 
       The destination file is always overwritten. 
       If this argument is not provided, the output will be printed to the 
       stdout.
 -v    Verbose mode. Valid only with the -o option.

Options:
 --footnotes on|off
 --hard-break on|off
 --no-soft-break on|off
 --raw-html on|off
 --smart-quotes on|off
 --validate-utf8 on|off
 --code on|off
 --debug on|off

Extensions:
 --autolink on|off
 --emoji image|font|off
 --github-mentions on|off
 --heads-anchor on|off
 --inline-images on|off
 --math on|off
 --table on|off
 --tag-filter on|off
 --tasklist on|off
 --strikethrough single|double|off
 --syntax-highlight on|off
 --yaml rmd|qmd|all|off

Unspecified rendering options will use the settings defined in the main application.

To handle multiple files at time you need to pass the -o arguments with a destination folder.

The CLI interface uses the same settings as the Quick Look extension, but you can override it if you wish.

Any relative paths inside raw HTML fragments are not updated according to the destination folder.

Build from source

When you clone this repository, remember to fetch also the submodule with git submodule update --init.

Some libraries (Sparkle, Yams and SwiftSoup) are handled by the Swift Package Manager. In case of problems it might be useful to reset the cache with the command from the menu File/Packages/Reset Package Caches.

Dependency

The app uses the following libraries built directly from Xcode:

  • highlight for syntax highlighting.
  • magic, used to guess the source code language when the guess mode is set to simple.
  • Enry, used to guess the source code language when the guess mode is set to accurate.
  • PCRE2 and JPCRE2 used by the heads extension.

libpcre require the autoconf utility to be build. You can install it with homebrew:

brew install autoconf

Because Enry is developed in go, to build the wrapper library you must have the go compiler installed (you can use brew install go).

The compilation of cmark-gfm require cmake (brew install cmake).

Note about security

To allow the Quick Look view of local images the application and the extension has an entitlement exception to allow only read access to the entire system.

On Big Sur there is a bug in the Quick Look engine and WebKit that cause the immediate crash of any WebView inside a Quick Look preview. To temporary fix this problem this Quick Look extension uses a com.apple.security.temporary-exception.mach-lookup.global-name entitlement.

Note about the developer

I am not primarily an application developer. There may be possible bugs in the code, be patient. Also, I am not a native English speaker ๐Ÿ˜….

Thanks to hazarek for the app icon and the CSS style.

This application was developed for pleasure โค๏ธ.

qlmarkdown's People

Contributors

mathjiajia avatar mccann avatar nikolai-cc avatar sbarex avatar setanarut avatar singularitti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qlmarkdown's Issues

Slow performance.

QLmarkdown 1.0 (21)

Model Identifier: MacBookPro13,3
Processor Name: Quad-Core Intel Core i7
Processor Speed: 2,7 GHz
Memory: 16 GB
SSD disk.

There is 1- 1.5 second delay for this README.md; https://github.com/mazznoer/colorgrad

Ekran.Kaydi.2021-02-05.20.35.58.mov

Notification of new UTI

dyn.ah62d4rv4ge8043a

Per the installation instructions, this is a new UTI.

Screen Shot 2021-10-26 at 11 56 55 PM

Macbook Pro 14-inch
MacOs Monterey 12.0.1

Feature request: rendering of YAML header as table

Hello,

Would it be possible to have an option to render the YAML header part as a table, maybe separated with a horizontal rule (line) ? Or maybe you can come up with even better :D

E.g.:

YAML header:

Title: My Title
Author: Steve jobs
Date: Tuesday, March 23, 2021
Abstract: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quisque id diam vel quam elementum pulvinar. Orci nulla pellentesque dignissim enim. Magna fringilla urna porttitor rhoncus dolor purus. Mollis nunc sed id semper risus in hendrerit gravida rutrum."

Becomes (equivalent markdown rendering):

|||
|-|-|
**Title** | My Title
**Author** | Steve jobs
**Date** | Tuesday, March 23, 2021
**Abstract** | "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quisque id diam vel quam elementum pulvinar. Orci nulla pellentesque dignissim enim. Magna fringilla urna porttitor rhoncus dolor purus. Mollis nunc sed id semper risus in hendrerit gravida rutrum."

Renders as:
image


I feel this is much more readable. Thank you so much for your extension !

System extension doesn't get installed

After launching the app, no extension is installed in Library/Extensions, so quick-looking an md file does not use QLMarkdown for rendering.

Running Big Sur 11.1 on a 2014 MBP.

Crash / libmagic library missing

Process:               QLMardown [1009]
Path:                  /Applications/QLMardown.app/Contents/MacOS/QLMardown
Identifier:            org.sbarex.QLMardown
Version:               1.0 (2)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           QLMardown [1009]
User ID:               501

Date/Time:             2020-12-26 23:57:41.511 +0300
OS Version:            macOS 11.1 (20C69)
Report Version:        12
Bridge OS Version:     3.0 (14Y908)
Anonymous UUID:        8B61B530-6807-470D-ACC0-1399548BB6D7


Time Awake Since Boot: 2000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  dyld: Using shared cache: 467A83CB-BA86-3F07-B652-B9256C74080A
Library not loaded: /usr/local/opt/libmagic/lib/libmagic.1.dylib
  Referenced from: /Applications/QLMardown.app/Contents/Frameworks/libwrapper_highlight.dylib
  Reason: image not found

Binary Images:
       0x10e594000 -        0x10e79bfff +org.sbarex.QLMardown (1.0 - 2) <D53EAE94-F0AF-3E45-9C3B-BEDF00FA2D17> /Applications/QLMardown.app/Contents/MacOS/QLMardown
       0x10f005000 -        0x10f180fff +libwrapper_highlight.dylib (0) <A7D06A54-A2F2-36FE-9C28-9596B5EC5059> /Applications/QLMardown.app/Contents/Frameworks/libwrapper_highlight.dylib
       0x111ce4000 -        0x111d7ffff  dyld (832.7.1) <DEA51514-B4E8-3368-979B-89D0F8397ABC> /usr/lib/dyld
    0x7fff201cc000 -     0x7fff20204fff  libobjc.A.dylib (818.2) <45EA2DE2-B612-3486-B156-2359CE279159> /usr/lib/libobjc.A.dylib
    0x7fff20291000 -     0x7fff202e6fff  libc++.1.dylib (904.4) <AE3A940A-7A9C-3F99-B175-3511528D8DFE> /usr/lib/libc++.1.dylib
    0x7fff203ac000 -     0x7fff20847fff  com.apple.CoreFoundation (6.9 - 1770.300) <EAC298C4-CE3E-3551-A832-42ED9A13EF74> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff21159000 -     0x7fff214bcfff  com.apple.Foundation (6.9 - 1770.300) <44A7115B-7FF0-3300-B61B-0FA71B63C715> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff22c0a000 -     0x7fff2396cfff  com.apple.AppKit (6.9 - 2022.20.119) <4CB42914-672D-3AF0-A0A5-2209088A3DA0> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    0x7fff24f0e000 -     0x7fff255a1fff  com.apple.CoreGraphics (2.0 - 1463.2.2) <323F725F-CB03-3AAD-AFBC-37B430B3FD4E> /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
    0x7fff2a531000 -     0x7fff2a532fff  libSystem.B.dylib (1292.60.1) <A7FB4899-9E04-37ED-9DD8-8FFF0400879C> /usr/lib/libSystem.B.dylib
    0x7fff2c706000 -     0x7fff2caecfff  libswiftCore.dylib (5.3.1 - 1200.2.41) <3C7C7068-C6C7-3C82-A7ED-4454766B8E0A> /usr/lib/swift/libswiftCore.dylib
    0x7fff2ff13000 -     0x7fff2ff13fff  com.apple.CoreServices (1122.11 - 1122.11) <5DDB040C-6E92-3DBE-9049-873F510F26E2> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x7fff30577000 -     0x7fff306ebfff  libswiftFoundation.dylib (20) <417CD1C7-A56A-3844-AAD9-6BFC3C348C13> /usr/lib/swift/libswiftFoundation.dylib
    0x7fff31636000 -     0x7fff3164bfff  libswiftDispatch.dylib (4.40.2) <B6AAD8BA-45E1-347F-B2B1-419F3D5BEACF> /usr/lib/swift/libswiftDispatch.dylib
    0x7fff335e2000 -     0x7fff335e3fff  libswiftObjectiveC.dylib (1) <AC2752B1-F2AB-375F-89CD-1A667587D9A3> /usr/lib/swift/libswiftObjectiveC.dylib
    0x7fff335e4000 -     0x7fff335f4fff  libswiftos.dylib (1000.40.3) <35AD02CD-7223-3923-BC84-2F894DBBDE97> /usr/lib/swift/libswiftos.dylib
    0x7fff3c467000 -     0x7fff3c471fff  libswiftCoreGraphics.dylib (2) <4958FE0E-ABB6-379B-9B0A-FE170AE0A87E> /usr/lib/swift/libswiftCoreGraphics.dylib
    0x7fff3c472000 -     0x7fff3c47bfff  libswiftDarwin.dylib (??? - ???) <CDFB8363-3A90-33F3-957A-FBC114E66F8D> /usr/lib/swift/libswiftDarwin.dylib
    0x7fff3dd1a000 -     0x7fff3dd1afff  libswiftCoreFoundation.dylib (1.6) <EEDE4AFB-E921-3B6E-BEF9-85E94B86F472> /usr/lib/swift/libswiftCoreFoundation.dylib
    0x7fff3dd26000 -     0x7fff3dd26fff  libswiftXPC.dylib (1.1) <AE90953B-1D6B-3716-81D2-65B76B5AF528> /usr/lib/swift/libswiftXPC.dylib
    0x7fff3dd27000 -     0x7fff3dd27fff  libswiftCoreImage.dylib (1) <9FA55C9D-E6C2-3B24-A43E-9388EE5DE86C> /usr/lib/swift/libswiftCoreImage.dylib
    0x7fff3dd28000 -     0x7fff3dd28fff  libswiftIOKit.dylib (1) <651621B4-9381-31FC-872B-E0BB9265EE9F> /usr/lib/swift/libswiftIOKit.dylib
    0x7fff4191f000 -     0x7fff41920fff  libswiftCoreLocation.dylib (5) <53B79035-0802-3E99-AD92-1F866D9A5DED> /usr/lib/swift/libswiftCoreLocation.dylib
    0x7fff42229000 -     0x7fff4222dfff  libswiftCoreData.dylib (3) <2EB3B3C4-7463-35AB-9CC8-778065C97FC5> /usr/lib/swift/libswiftCoreData.dylib
    0x7fff464fe000 -     0x7fff46503fff  libswiftMetal.dylib (1.3.1) <24B7851E-1439-3184-96EF-2780602A61E4> /usr/lib/swift/libswiftMetal.dylib
    0x7fff4650a000 -     0x7fff46515fff  libswiftCloudKit.dylib (962) <FC90CD4E-614F-3673-9E13-81B0DF025909> /usr/lib/swift/libswiftCloudKit.dylib
    0x7fff48b0f000 -     0x7fff48b23fff  libswiftAppKit.dylib (103.10) <A8A94895-CE8D-35B2-8E1C-CC19A8140E98> /usr/lib/swift/libswiftAppKit.dylib
    0x7fff48b24000 -     0x7fff48b25fff  libswiftQuartzCore.dylib (1) <8EA8BAF8-E175-3167-B80C-0CF36505E599> /usr/lib/swift/libswiftQuartzCore.dylib
    0x7fff4f571000 -     0x7fff4f572fff  libswiftOSLog.dylib (1) <E973C27B-18D1-3814-9442-A7B18EB7D78C> /usr/lib/swift/libswiftOSLog.dylib
    0x7fff59208000 -     0x7fff5920bfff  libswiftWebKit.dylib (7610.3.7.1.9) <958BE7A5-A772-319F-85E0-489F30273410> /usr/lib/swift/libswiftWebKit.dylib

Model: MacBookPro13,3, BootROM 429.60.3.0.0, 4 processors, Quad-Core Intel Core i7, 2,7 GHz, 16 GB, SMC 2.38f11
Graphics: kHW_IntelHDGraphics530Item, Intel HD Graphics 530, spdisplays_builtin
Graphics: kHW_AMDRadeonPro455Item, AMD Radeon Pro 455, spdisplays_pcie_device, 2 GB
Memory Module: BANK 0/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320
Memory Module: BANK 1/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x15A), Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1675.1)
Bluetooth: Version 8.0.2f9, 3 services, 18 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB 3.0 Bus
USB Device: Apple T1 Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 41.2
Thunderbolt Bus: MacBook Pro, Apple Inc., 41.2

README footnotes don't render on GitHub

[minor cosmetic issue]

In a possibly ironic twist, the [^footnote] marks in the README.md file don't render in the browser as jump links and just appear as plain text on the GitHub repo page displaying the README file.

I'm guessing this is a markdown feature not supported by GitHub.

Image embedding sadly skipped if filename contains whitespace

Rendering Result in QLMarkdown vs. Macdown

Embedded image with whitespace in file name are not rendered but shown as raw markup text

Reproduction

  • Create a `.md? file
  • In the markdown source embed an image with ![](file name having whitespace.png)
    • That is a relative link to an image file on the same hierarchy as the markdown file with whitespace in the file name.
  • Anywhere image placement is allowed, i.e. in the body or in a table.

Sample

## Images

### Filename without whitespace

![](1.png)

### Filename with whitespace

![](1 b.png)

## Table

| Column One     | Column Two    |
| :---           | :---          |
| Text 1         | Text 2        |
| ![](1.png)     | ![](1 b.png)  |
| ![](1.png)     | ![](1.png)    |
| ![](1 b.png)   | ![](1 b.png)  |

Expected

  • The image thumbnail/preview is shown regardless if the filename contains whitespace or not.
    • Everything between the round brackets is considered the filepath.
    • Round brackets in filenames need escaping of course.
    • Whitespace is escaped by the system automatically
    • If it does not start with a slash it is considered a relative path.
  • Macdown handles it like that.

Actual

  • Images containing whitespace in their filename are skipped and instead the raw markup text is shown.

Update error

Ekran Resmi 2020-12-29 21 50 00

I think it happened because the application name changed.

Lag while page scrolling and header anchor jumping

Only when viewing in full screen. I am experiencing heavy freezes when scrolling two fingers. this only happens in .md preview with qlmarkdown.

  1. View a long markdown file in full screen and swipe with your finger.
  2. Click on the table of contents, it jumps with a few seconds delay.

For this reason I could not test other settings. #25. Also "open on default browser" doesn't work.

WebP, SVG and Placeholder Video Thumbnail Support.

I know, Github's README.MD does not support inline SVG , WebP and videos. Maybe features specific to macOS can be considered.

The Quick Look HTML preview supports the following;

  • SVG
  • WebP (Animated and Static)
  • Placeholder Video Thumbnail

QLMarkdown cannot display the following;

Inline HTML

  • WebP (Animated and Static) - <img src="image.webp" alt="">
  • Placeholder Video Thumbnail - <source src="video.mov" type="video/mp4">

Markdown

  • SVG - ![SVG](image.svg)
  • WebP - ![WEBP](image.webp)

Note: Embedded webp is not displayed. <img src="data:image/webp;base64........

Ekran Resmi 2021-01-18 03 54 38

Fragment links inside document broken

Title is a bit misleading, not all of them are broken but some. Presumably due to the handling of special characters.

link to [section](#a-preamble)

### A) Preamble
...

Github is removing special characters before creating the title reflink label. In the case above the closing parenthesis. Though I don't know what the set of special characters is. But the example above does work on Github โ€“ just not in the preview.

Syntax highlighting for wikilinks?

image

Hi, thank you for making this! This is great. Wikilinks are common in all of the markdown tools that I use, so I was wondering if we could get syntax highlighting for that?

image
Here's how it renders in my application of choice, Obsidian

Feature request: rendering of admonitions

Hello again,

Would it be possible to add an option to render admonitions?

!!! question Can you make the best Quicklook markdown previewed ever ?
    YES !

image

Here's examples of how to render them nicely:


If you're really up for the challenge, there's ALOT of insanely great features and beautiful rendering ideas that could be integrated into this previewer: MkDocs Material Design > Reference

Codeblock with HTML: Works fine in sbarex fork of QLMarkdown

@sbarex

  • thanks for providing a contemporary fork of the original QLMarkdown.
  • Installation via brew was super convenient (on macOS 11.6 Big Sur)
  • QuickLook of .md Markdown files worked instantly after having opened /Applications/QLMarkdown.app for the first time.

๐Ÿ‘ And you fixed something which did not work in the old QLMarkdown:

Bug of the original

QLMarkdown chokes on codeblock with HTML

Fixed in your fork โ€” Nice!

QLMarkdown fork of sbarex handles all 3 codeblocks fine

License contradiction

The about window does not comply with the GNU General Public License v3.0 license.

Copyright ยฉ 2020 SBAREX. All rights reserved.

about

[BUG] Scroll wheel input ignored

I cannot scroll using my mouse on the preview generated from QLMarkdown using my external mouse. Other previews work fine (PDFs, TXT, RTF,...)

Useful information

  • OS: BigSur 11.3.1
  • Mouse: Razer, no additional software
  • QLMarkdown 1.0
  • Trackpad seems fine, but mouse input gets ignored and freezes app

Crash report form console.app

Markdown QL Extension_2021-05-23-210845_MacBook-Pro.txt

qlmanage -m report

QLmanageDump.txt

PS: I think SourceCodeSyntaxHighlight has this same bug, but console.app doesn't report anything

Processes open but never quit

This is on MacOS 12.0 beta, so I'm only adding it because I don't see it listed yet:

When quicklooking files, the Markdown QL Extension Web Content process is launched, once for every file viewed, but those processes never close.

Although they do not appear to be using CPU each process is eating about 10MB of RAM. Today after doing a bunch of file maintenance I realized QLMarkdown was using 700+ MB of RAM

Crash v1.0b4 Sparke Framework not included

Dyld Error Message:
  Library not loaded: @rpath/Sparkle.framework/Versions/A/Sparkle
  Referenced from: /Users/USER/Downloads/QLMardown.app/Contents/MacOS/QLMardown
  Reason: image not found

1.0b21 no longer working

On two Catalina machines, after the b21 update (or perhaps the b20 update as well, not sure) the system refuses to allow the quicklook component to run.

qlm1

Then right-click the app and select "Open":
ql3

Then try to quicklook a .md file in Finder:
qlm2

bug on css emoji font

The document font is set to -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji, Segoe UI Emoji;.

In this way some emoji are rendered with system font and not the apple color. For example the heart.

heart

Two solutions:

  • encapusulte the emoji inside a <span class="emoji">โค</span> and customize the font for the class in the CSS
  • change the document font to 'Apple Color Emoji, Segoe UI Emoji, -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif'. In this way I do not know if the are others unwanted effects.

@hazarek what do you think?

Wrong Task-list generation.

The task list looks like an ordinary list.
Ekran Resmi 2020-12-29 22 19 50

ul.contains-task-list class not defined in output html file. It cannot be manipulated with css. other lists will be affected.

Ekran Resmi 2020-12-29 21 40 15

markdown.css

.markdown-body ul.contains-task-list {
  list-style: none;
  padding-left: 0;
}

Error while preview

Ekran Resmi 2020-12-27 01 52 54

QLMarkdown - Version 1.0 (3)

translation: There was an error in the org.sparex.QLMarkdown.QLExtension extension while previewing the document.

reproduction;

1. git clone https://github.com/hazarek/go-md-turkce-kaynaklar
2. preview go-md-turkce-kaynaklar/go-programlama-dili/02-bolum-1-on-egitim.md

Feature Request: rendering of definition lists

Hello,

I just wanted to point out that definition lists don't seem to be rendered, was wondering if this was a bug or just not included. If it isn't included, can it be ?

term1
: definition of term1

term2
: definition of term2

image


Thank you for the wonderful extension, this is super useful !

Auto-update not triggering

Every release that is pushed, running QLMarkdown.app does not trigger an auto-update. I have to manually go to the QLMarkdown menu and select 'Check for Updates'. Can we add the new version notification popup dialog to Sparkle here?

Code rendering for shell script breaks for dashes

I don't know if this issue is related to QLMarkdown or a third party code syntax parser. But a text element in a path that contains a dash will be shown as if it were a command parameter. Even though there is no whitespace before.

screen

A new UTI ?

Hello,

You kindly ask to report such new entry, so, here it is : on Monterey, it looks like the

mdls -name kMDItemContentType PATH_OF_AN_EXISTS_MD_FILE

is giving a new beast

kMDItemContentType = "public.markdown"

which, maybe, explains why, on my MacBook Pro (M1 Max), your so appreciated QuickLook extension is not working anymore.

Title for regular .md header (feature request)

Wonderful Quick Look extension; thank you for creating it!

It would be great if YAML blocks would also be rendered as a code block for regular (.md suffix) Markdown, not just .rmd.

Thank you for looking into this.
QL title

Version confusion.

Github Release - > 1.0b21
About window -> 1.0 (21)
Finder info dialog -> 1.0
You're up to date - > 1.0

Ekran Resmi 2021-02-05 20 49 14

Also these files do not have a version number.

Ekran Resmi 2021-02-05 21 00 27

It should be that way.
QLMarkdown.1.0b21.zip

Crash while browsing through themes

Clicking on the โ€œOliveโ€ theme can reproducibly crash the application.

Crashing on exception: -[__SwiftValue _getValue:forType:]: unrecognized selector sent to instance 0x6000025c0cf0

Clipboard doesn't work in Spotlight preview.

I often use the Spotlight window to copy text to the clipboard. I can use clipboard for TXT, CSV files. but in QLMarkdown preview I can only copy the file path. (Press TAB key to open preview during Spotlight search.)

TXT example

clipboard_txt.mov

MD example

clipboard_md.mov

Feature Requests

  1. Factory reset option for reset all settings.
  2. Line numbers should be turned off by default. does not fit the default theme. ( Github style )
  3. The editor on the left should use a monospace font by default. (Menlo)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.