Skip to content

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

@hayashih

Description

@hayashih

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にして常に新しい内容で書き換えるようになりませんか?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions