mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 02:09:05 +00:00
@@ -25,7 +25,7 @@ namespace QuickLook.Plugin.ArchiveViewer;
|
|||||||
|
|
||||||
public class Plugin : IViewer
|
public class Plugin : IViewer
|
||||||
{
|
{
|
||||||
private static readonly string[] Extensions =
|
private static readonly string[] _extensions =
|
||||||
[
|
[
|
||||||
".7z",
|
".7z",
|
||||||
".bz2",
|
".bz2",
|
||||||
@@ -50,7 +50,7 @@ public class Plugin : IViewer
|
|||||||
|
|
||||||
public bool CanHandle(string path)
|
public bool CanHandle(string path)
|
||||||
{
|
{
|
||||||
return !Directory.Exists(path) && Extensions.Any(path.ToLower().EndsWith);
|
return !Directory.Exists(path) && _extensions.Any(path.ToLower().EndsWith);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Prepare(string path, ContextObject context)
|
public void Prepare(string path, ContextObject context)
|
||||||
|
@@ -25,8 +25,8 @@ namespace QuickLook.Plugin.HtmlViewer;
|
|||||||
|
|
||||||
public class Plugin : IViewer
|
public class Plugin : IViewer
|
||||||
{
|
{
|
||||||
private static readonly string[] Extensions = [".mht", ".mhtml", ".htm", ".html"];
|
private static readonly string[] _extensions = [".mht", ".mhtml", ".htm", ".html"];
|
||||||
private static readonly string[] SupportedProtocols = ["http", "https"];
|
private static readonly string[] _supportedProtocols = ["http", "https"];
|
||||||
|
|
||||||
private WebpagePanel _panel;
|
private WebpagePanel _panel;
|
||||||
|
|
||||||
@@ -38,9 +38,9 @@ public class Plugin : IViewer
|
|||||||
|
|
||||||
public bool CanHandle(string path)
|
public bool CanHandle(string path)
|
||||||
{
|
{
|
||||||
return !Directory.Exists(path) && (Extensions.Any(path.ToLower().EndsWith) ||
|
return !Directory.Exists(path) && (_extensions.Any(path.ToLower().EndsWith) ||
|
||||||
path.ToLower().EndsWith(".url") &&
|
path.ToLower().EndsWith(".url") &&
|
||||||
SupportedProtocols.Contains(Helper.GetUrlPath(path).Split(':')[0]
|
_supportedProtocols.Contains(Helper.GetUrlPath(path).Split(':')[0]
|
||||||
.ToLower()));
|
.ToLower()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -34,6 +34,23 @@ public class Plugin : IViewer
|
|||||||
private WebpagePanel? _panel;
|
private WebpagePanel? _panel;
|
||||||
private string? _currentHtmlPath;
|
private string? _currentHtmlPath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Markdown and Markdown-like extensions
|
||||||
|
/// It is not guaranteed to support all formats perfectly
|
||||||
|
/// </summary>
|
||||||
|
private static readonly string[] _extensions =
|
||||||
|
[
|
||||||
|
".md", ".markdown", // The most common Markdown extensions
|
||||||
|
".mdx", // MDX (Markdown + JSX), used in React ecosystems
|
||||||
|
".mmd", // MultiMarkdown (MMD), an extended version of Markdown
|
||||||
|
".mkd", ".mdwn", ".mdown", // Early Markdown variants, used by different parsers like Pandoc, Gitit, and Hakyll
|
||||||
|
".mdc", // A Markdown variant used by Cursor AI [Repeated format from ImageViewer]
|
||||||
|
".qmd", // Quarto Markdown, developed by RStudio for scientific computing and reproducible reports
|
||||||
|
".rmd", ".rmarkdown", // R Markdown, mainly used in RStudio
|
||||||
|
".apib", // API Blueprint, a Markdown-based format
|
||||||
|
".mdtxt", ".mdtext", // Less common
|
||||||
|
];
|
||||||
|
|
||||||
private static readonly string _resourcePath = Path.Combine(SettingHelper.LocalDataPath, "QuickLook.Plugin.MarkdownViewer");
|
private static readonly string _resourcePath = Path.Combine(SettingHelper.LocalDataPath, "QuickLook.Plugin.MarkdownViewer");
|
||||||
private static readonly string _resourcePrefix = "QuickLook.Plugin.MarkdownViewer.Resources.";
|
private static readonly string _resourcePrefix = "QuickLook.Plugin.MarkdownViewer.Resources.";
|
||||||
private static readonly ResourceManager _resourceManager = new(_resourcePath, _resourcePrefix);
|
private static readonly ResourceManager _resourceManager = new(_resourcePath, _resourcePrefix);
|
||||||
@@ -51,7 +68,7 @@ public class Plugin : IViewer
|
|||||||
|
|
||||||
public bool CanHandle(string path)
|
public bool CanHandle(string path)
|
||||||
{
|
{
|
||||||
return !Directory.Exists(path) && new[] { ".md", ".mdown", ".rmd", ".markdown" }.Any(path.ToLower().EndsWith);
|
return !Directory.Exists(path) && _extensions.Any(path.ToLower().EndsWith);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Prepare(string path, ContextObject context)
|
public void Prepare(string path, ContextObject context)
|
||||||
|
@@ -25,7 +25,7 @@ namespace QuickLook.Plugin.PEViewer;
|
|||||||
|
|
||||||
public class Plugin : IViewer
|
public class Plugin : IViewer
|
||||||
{
|
{
|
||||||
private static readonly string[] Extensions =
|
private static readonly string[] _extensions =
|
||||||
[
|
[
|
||||||
".exe", ".sys", ".scr", ".ocx", ".cpl", ".bpl",
|
".exe", ".sys", ".scr", ".ocx", ".cpl", ".bpl",
|
||||||
".dll", ".ax", ".drv", ".vxd",
|
".dll", ".ax", ".drv", ".vxd",
|
||||||
@@ -46,7 +46,7 @@ public class Plugin : IViewer
|
|||||||
|
|
||||||
public bool CanHandle(string path)
|
public bool CanHandle(string path)
|
||||||
{
|
{
|
||||||
return !Directory.Exists(path) && Extensions.Any(path.ToLower().EndsWith);
|
return !Directory.Exists(path) && _extensions.Any(path.ToLower().EndsWith);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Prepare(string path, ContextObject context)
|
public void Prepare(string path, ContextObject context)
|
||||||
|
Reference in New Issue
Block a user