Change parsedPlot() to use Regex instead of simple string operations
This commit is contained in:
parent
1a17241a8a
commit
b1224f5c5b
@ -1134,9 +1134,11 @@
|
|||||||
|
|
||||||
function parsePlot(plottext) {
|
function parsePlot(plottext) {
|
||||||
|
|
||||||
var tstring = plottext.replace(/\s+/g, " ");
|
var tstring = plottext.replace(/\s+/g, " ") // collapse all whitespace to single whitespace
|
||||||
tstring = tstring.trim();
|
tstring = tstring.trim(); // trim whitespace from both ends
|
||||||
tstring = tstring.split(") -> (");
|
tstring = tstring.replace(/\)\s*\->\s*\(/g, ")->(");
|
||||||
|
|
||||||
|
tstring = tstring.split(")->("); // split string based on the delimiter
|
||||||
|
|
||||||
if (tstring.length > 0) {
|
if (tstring.length > 0) {
|
||||||
if (tstring[0].trim()[0] == "(") {
|
if (tstring[0].trim()[0] == "(") {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user