diff --git a/modules/markout/lib/markout.js b/modules/markout/lib/markout.js index 489349055..4894497db 100644 --- a/modules/markout/lib/markout.js +++ b/modules/markout/lib/markout.js @@ -349,19 +349,20 @@ MarkOut.prototype.convertMD = function(sIndent) sMD = sMD.replace(//g, ""); /* - * If the Markdown begins with a triple-dash, we assume there's a "Front Matter" header at the - * top of the file that we don't want to output, either. One wrinkle: we assume that if a - * "title" element exists in the Front Matter, then we should auto-generate a top-level heading - * with the same value. + * If the Markdown begins with a triple-dash, see if there's a "Front Matter" header at the + * top of the file that we should suppress. */ if (sMD.substr(0, 3) == "---") { aMatch = sMD.match(/^---([\s\S]*?)---[ \t]*\n*/); if (aMatch) { sMD = sMD.replace(aMatch[0], ""); - aMatch = aMatch[1].match(/title:\s*(.*?)\s*?\n/); - if (aMatch) { - sMD = aMatch[1] + "\n---\n\n" + sMD; - } + /* + * If a "title" element existed in the Front Matter, then you can enable this code to + * auto-generate a top-level heading with the same value. + * + * aMatch = aMatch[1].match(/title:\s*(.*?)\s*?\n/); + * if (aMatch) sMD = aMatch[1] + "\n---\n\n" + sMD; + */ } } diff --git a/modules/pcjs/lib/fdc.js b/modules/pcjs/lib/fdc.js index cba7500d1..2827ca35d 100644 --- a/modules/pcjs/lib/fdc.js +++ b/modules/pcjs/lib/fdc.js @@ -1403,7 +1403,7 @@ FDC.prototype.doneLoadDiskette = function onFDCLoadNotify(drive, disk, sDiskette FDC.prototype.addDiskette = function(sName, sPath) { var controlDisks = this.bindings["listDisks"]; - if (controlDisks) { + if (controlDisks && controlDisks.options) { for (var i = 0; i < controlDisks.options.length; i++) { if (controlDisks.options[i].value == sPath) return; } @@ -1433,7 +1433,7 @@ FDC.prototype.displayDiskette = function(iDrive, fUpdateDrive) /* * Next, make sure controls for both drives and disks exist. */ - if (controlDisks && controlDrives) { + if (controlDisks && controlDrives && controlDisks.options && controlDrives.options) { /* * Next, make sure the drive whose disk we're updating is the currently selected drive. */ diff --git a/modules/shared/lib/embed.js b/modules/shared/lib/embed.js index 93fcd208f..48760fc1a 100644 --- a/modules/shared/lib/embed.js +++ b/modules/shared/lib/embed.js @@ -403,15 +403,19 @@ function embedMachine(sName, sVersion, idElement, sXMLFile, sXSLFile, sStateFile xsltProcessor['importStylesheet'](xsl); var eFragment = xsltProcessor['transformToFragment'](xml, window.document); if (eFragment) { + /* + * This fails in Microsoft Edge... + * var machine = eFragment.getElementById(idElement); if (!machine) { displayError("machine generation failed: " + idElement); - } - else if (!eMachine.parentNode) { - displayError("invalid machine element: " + idElement); - } else { + } else + */ + if (eMachine.parentNode) { eMachine.parentNode.replaceChild(eFragment, eMachine); doneMachine(); + } else { + displayError("invalid machine element: " + idElement); } } else { displayError("transformToFragment failed");