Go back from Webkit to IE render engine

This commit is contained in:
Paddy Xu
2017-06-01 19:49:54 +03:00
parent 134c164a7e
commit f58ef0dcb6
28 changed files with 352 additions and 14573 deletions

View File

@@ -1,27 +0,0 @@
using System.IO;
using System.Text;
namespace QuickLook.Plugin.HtmlViewer
{
internal static class UrlHelper
{
internal static string FilePathToFileUrl(string filePath)
{
var uri = new StringBuilder();
foreach (var v in filePath)
if (v >= 'a' && v <= 'z' || v >= 'A' && v <= 'Z' || v >= '0' && v <= '9' ||
v == '+' || v == '/' || v == ':' || v == '.' || v == '-' || v == '_' || v == '~' ||
v > '\xFF')
uri.Append(v);
else if (v == Path.DirectorySeparatorChar || v == Path.AltDirectorySeparatorChar)
uri.Append('/');
else
uri.Append($"%{(int) v:X2}");
if (uri.Length >= 2 && uri[0] == '/' && uri[1] == '/') // UNC path
uri.Insert(0, "file:");
else
uri.Insert(0, "file:///");
return uri.ToString();
}
}
}