Permalink
Browse files

Preview window html now works correctly with utf-8.

Fixes #1.
  • Loading branch information...
Noah Richards
Noah Richards committed Jun 25, 2011
1 parent fd15c1f commit c7c761319bab2b20cea4cf4cd38e98da7dacc31c
Showing with 4 additions and 1 deletion.
  1. +4 −1 ToolWindow/PreviewWindowUpdateListener.cs
@@ -64,12 +64,15 @@ MarkdownPreviewToolWindow GetPreviewWindow(bool create)
string GetHTMLText(bool extraSpace = false)
{
- StringBuilder html = new StringBuilder(markdownTransform.Transform(textView.TextBuffer.CurrentSnapshot.GetText()));
+ StringBuilder html = new StringBuilder();
+ html.AppendLine("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head><body>");
+ html.AppendLine(markdownTransform.Transform(textView.TextBuffer.CurrentSnapshot.GetText()));
if (extraSpace)
{
for (int i = 0; i < 20; i++)
html.Append("<br />");
}
+ html.AppendLine("</body></html>");
return html.ToString();
}

0 comments on commit c7c7613

Please sign in to comment.