MarkDownSharpEditor icon indicating copy to clipboard operation
MarkDownSharpEditor copied to clipboard

プレビュー用の一時HTMLファイルが壊れる

Open hayashih opened this issue 12 years ago • 0 comments

Form1.csの1311行目 backgroundWorker1_DoWorkの中

                using (FileStream fs = new FileStream(
                    _TemporaryHtmlFilePath,
                    FileMode.OpenOrCreate, FileAccess.ReadWrite,     FileShare.Read | FileShare.Delete))
                {
                    fs.Write(bytesData, 0, bytesData.Length);
                    e.Result = _TemporaryHtmlFilePath;
                }

FileMode.OpenOrCreateをFileMode.Create になってほしいです。

長いmarkdownファイルを開いて後ろの方をたくさん削除した場合 fs.Write(bytesData, 0, bytesData.Length); で上書きしているのでプレビュー用HTMLに以前のデータの残骸が残り、HTMLが壊れてしまいます。

FileMode.Createにして常に新しい内容で書き換えるようになりませんか?

hayashih avatar Dec 05 '13 03:12 hayashih