/ Published in: C#
using markdown sharp
StreamReader to read template & StreamWriter to write to HTML
Expand |
Embed | Plain Text
string html; string theme; StreamReader reader; html = parser.Transform(txtEditor.Text); theme = reader.ReadToEnd(); html = Regex.Replace(theme, "{body}", html); html = Regex.Replace(html, "{title}", "Markdown Edit Document"); webPreview.NavigateToString(html); writer.Write(html); writer.Flush(); writer.Close(); reader.Close(); // html template like ... <!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <title>{title}</title> </head> <body> {body} </body> </html>
You need to login to post a comment.
