1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-06 16:29:03 +00:00

Replace '#' with '_' in .html filename

If you link to the file without escaping the '#', the browser will
think it's an anchor inside the page.  Easier on everyone to just
alter the filename.
This commit is contained in:
Andy McFadden 2019-10-10 14:00:52 -07:00
parent 6d886ecc3a
commit 94a7f2e8fb

View File

@ -312,6 +312,11 @@ namespace SourceGen.WpfGui {
private void Finish(string fileFilter, string fileExt) {
Debug.Assert(mProjectFileName == Path.GetFileName(mProjectFileName));
string initialName = Path.GetFileNameWithoutExtension(mProjectFileName) + fileExt;
if (GenType == GenerateFileType.Html) {
// Can't link to a file with an unescaped '#' -- the browser will think
// it's an anchor.
initialName = initialName.Replace('#', '_');
}
SaveFileDialog fileDlg = new SaveFileDialog() {
Filter = fileFilter + "|" + Res.Strings.FILE_FILTER_ALL,