Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
segments.map(segment => {
// determine if the segment is a die or not
if (XRegExp.test(segment, dieRegex)) {
// this is a die - parse it into an object and add to the list
parsed.push(...parseDie(segment));
} else {
// not a die (ie. number, operator)
if(diceUtils.isNumeric(segment)){
segment = parseFloat(segment);
}
// add to the list
parsed.push(segment);
}
});
}
test(url: string): boolean {
return XRegExp.test(url, this.regex);
}
txt = xre.replace(txt, xre("([ \\t]+)\\.([ \\t]+)(.+?\\n(?:\\1 \\2.*?\\n)*)", "sg"), "<li>$3</li>");
txt = conv(0, txt);
html_spec += "<ul class="\"list\"">";
html_spec += txt + "\n";
html_spec += "</ul>";
}
else if (xre.test(txt, xre("^\\s*\\+\\s", "s"))) {
txt = xre.replace(txt, xre("^\\s*\\+\\s", "mg"), "");
txt = conv(0, txt);
txt = xre.replace(txt, xre("^(.+)$", "mg"), "$1");
txt = xre.replace(txt, xre("(\\s+)\\+(\\s+)", "sg"), "");
html_spec += "";
html_spec += txt + "\n";
html_spec += "<table class="\"tabular\""></table>";
}
else if (!xre.test(txt, xre("^\\s+$", "s"))) {
txt = conv(0, txt);
txt = xre.replace(txt, xre("[ \\t]{2,}", "sg"), " ");
html_spec += "<div class="\"desc\"">";
html_spec += txt + "\n";
html_spec += "</div>";
}
}
pattern => XRegExp.test(content, XRegExp(pattern))
);
return this.patterns.some(pattern => {
return XRegExp.test(lineText, XRegExp(pattern));
});
}
function parse5b (txt) {
if (xre.test(txt, xre("^\\s*\\|\\s", "s"))) {
txt = xre.replace(txt, xre("^\\s*\\|\\s", "mg"), "");
txt = conv(0, txt);
txt = xre.replace(txt, xre("\\n+$", "s"), "");
txt = xre.replace(txt, xre("^\\s+", "s"), "");
html_spec += "<div class="\"example\"">";
html_spec += txt + "\n";
html_spec += "</div>";
}
else if (xre.test(txt, xre("^\\s*Notice:\\s+", "s"))) {
txt = conv(0, txt);
html_spec += "<div class="\"notice\"">";
html_spec += txt + "\n";
html_spec += "</div>";
}
else if (xre.test(txt, xre("^\\s*\\.\\s", "s"))) {
txt = xre.replace(txt, xre("([ \\t]+)\\.([ \\t]+)(.+?\\n(?:\\1 \\2.*?\\n)*)", "sg"), "<li>$3</li>");
txt = conv(0, txt);
html_spec += "<ul class="\"list\"">";
html_spec += txt + "\n";
html_spec += "</ul>";
}
else if (xre.test(txt, xre("^\\s*\\+\\s", "s"))) {
txt = xre.replace(txt, xre("^\\s*\\+\\s", "mg"), "");
txt = conv(0, txt);
txt = xre.replace(txt, xre("^(.+)$", "mg"), "$1");