mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 10:19:07 +00:00
Add MakefileDetector for text viewer
This commit is contained in:
@@ -27,13 +27,16 @@ public class FormatDetector
|
||||
[
|
||||
new XMLDetector(),
|
||||
new JSONDetector(),
|
||||
new MakefileDetector(),
|
||||
];
|
||||
|
||||
public static IFormatDetector Detect(string text)
|
||||
public static IFormatDetector Detect(string path, string text)
|
||||
{
|
||||
_ = path;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(text)) return null;
|
||||
|
||||
return Instance.TextDetectors.Where(detector => detector.Detect(text))
|
||||
return Instance.TextDetectors.Where(detector => detector.Detect(path, text))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
@@ -44,5 +47,5 @@ public interface IFormatDetector
|
||||
|
||||
public string Extension { get; }
|
||||
|
||||
public bool Detect(string text);
|
||||
public bool Detect(string path, string text);
|
||||
}
|
||||
|
Reference in New Issue
Block a user