Use built-in method instead.

Squashed commit of the following:

commit f7887aeda7
Author: Milly <milly.ca@gmail.com>
Date:   Fri Jun 23 09:26:58 2017 +0900

    Replace "&", "<", ">" to HTML entities in Markdown.
This commit is contained in:
Milly
2017-07-01 12:38:36 +03:00
committed by Paddy Xu
parent 574ef7d8a3
commit 924d8dd49e

View File

@@ -17,6 +17,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Net;
using System.Windows; using System.Windows;
using System.Windows.Threading; using System.Windows.Threading;
using QuickLook.Plugin.HtmlViewer; using QuickLook.Plugin.HtmlViewer;
@@ -84,6 +85,8 @@ namespace QuickLook.Plugin.MarkdownViewer
private string GenerateMarkdownHtml(string path) private string GenerateMarkdownHtml(string path)
{ {
var md = File.ReadAllText(path); var md = File.ReadAllText(path);
md = WebUtility.HtmlEncode(md);
var html = Resources.md2html.Replace("{{content}}", md); var html = Resources.md2html.Replace("{{content}}", md);
return html; return html;