Allow string properties to contain '|'

This commit is contained in:
Jeff Parsons 2016-02-01 10:22:54 -08:00
commit 2690097a48
2 changed files with 7 additions and 7 deletions

View file

@ -9,7 +9,7 @@ machines:
automount: automount:
A: A:
path: /disks/pc/os2/misc/football/FOOTBALL-76817.json path: /disks/pc/os2/misc/football/FOOTBALL-76817.json
messages: disk messages: disk|data
--- ---
OS/2 FOOTBALL Boot Disk (v7.68.17) OS/2 FOOTBALL Boot Disk (v7.68.17)

View file

@ -1040,10 +1040,10 @@ MarkOut.prototype.convertMDImageLinks = function(sBlock, sIndent)
* *
* If the link ends with a slash, then it's an implied reference to a "machine.xml". * If the link ends with a slash, then it's an implied reference to a "machine.xml".
* *
* UPDATE: Since parms containing JSON may also contain colons, machine Markdown links may now use '|' * UPDATE: Since parms containing JSON may also contain colons, machine Markdown links may now use '!' instead
* instead of ':' as separators; eg: * of ':' as separators; eg:
* *
* [IBM PC](/devices/pc/machine/5150/mda/64kb/ "PCjs|demoPC|stylesheet|version|options|parms") * [IBM PC](/devices/pc/machine/5150/mda/64kb/ "PCjs!demoPC!stylesheet!version!options!parms")
* *
* Granted, there are a number of things we could be smarter about. First, you probably don't care about the * Granted, there are a number of things we could be smarter about. First, you probably don't care about the
* ID for the <div>; it's purely a mechanism for telling the script where to embed the machine, so we could * ID for the <div>; it's purely a mechanism for telling the script where to embed the machine, so we could
@ -1089,7 +1089,7 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock)
sMachineXSLFile = machine['template'] || ""; sMachineXSLFile = machine['template'] || "";
sMachineVersion = (machine['uncompiled'] && machine['uncompiled'] == "true"? "uncompiled" : ""); sMachineVersion = (machine['uncompiled'] && machine['uncompiled'] == "true"? "uncompiled" : "");
sMachineParms = machine['parms'] || ""; sMachineParms = machine['parms'] || "";
sReplacement = "[Embedded PC](" + sMachineXMLFile + ' "' + sMachine + 'js|' + sMachineID + '|' + sMachineXSLFile + '||' + sMachineOptions + '|' + sMachineParms + '")'; sReplacement = "[Embedded PC](" + sMachineXMLFile + ' "' + sMachine + 'js!' + sMachineID + '!' + sMachineXSLFile + '!!' + sMachineOptions + '!' + sMachineParms + '")';
} }
sBlock = sBlock.replace(aMatch[0], sReplacement); sBlock = sBlock.replace(aMatch[0], sReplacement);
reIncludes.lastIndex = 0; // reset lastIndex, since we just modified the string that reIncludes is iterating over reIncludes.lastIndex = 0; // reset lastIndex, since we just modified the string that reIncludes is iterating over
@ -1099,7 +1099,7 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock)
* Start looking for Markdown-style machine links now... * Start looking for Markdown-style machine links now...
*/ */
var cMatches = 0; var cMatches = 0;
var reMachines = /\[(.*?)]\((.*?)\s*"(PC|C1P)js[:|](.*?)"\)/gi; var reMachines = /\[(.*?)]\((.*?)\s*"(PC|C1P)js[:!](.*?)"\)/gi;
while ((aMatch = reMachines.exec(sBlock))) { while ((aMatch = reMachines.exec(sBlock))) {
@ -1109,7 +1109,7 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock)
sMachine = aMatch[3].toUpperCase(); sMachine = aMatch[3].toUpperCase();
var sMachineFunc = "embed" + sMachine; var sMachineFunc = "embed" + sMachine;
var sMachineClass = sMachine.toLowerCase(); var sMachineClass = sMachine.toLowerCase();
var aMachineParms = aMatch[4].split(aMatch[4].indexOf('|') > 0? '|' : ':'); var aMachineParms = aMatch[4].split(aMatch[4].indexOf('|') > 0? '!' : ':');
var sMachineMessage = "Waiting for " + sMachine + "js to load"; var sMachineMessage = "Waiting for " + sMachine + "js to load";
sMachineID = aMachineParms[0]; sMachineID = aMachineParms[0];