Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions argos@pew.worldwidemann.com/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ function parseFilename(filename) {
function parseLine(lineString) {
let line = {};

let separatorIndex = lineString.indexOf("|");
let separatedLine = GLib.regex_split_simple("(?<!\\\\)\\|", lineString, 0, 0);
line.text = separatedLine.shift();

if (separatorIndex >= 0) {
if (separatedLine.length > 0) {
let attributes = [];
try {
attributes = GLib.shell_parse_argv(lineString.substring(separatorIndex + 1))[1];
attributes = GLib.shell_parse_argv(separatedLine.join('|'))[1];
} catch (error) {
log("Unable to parse attributes for line '" + lineString + "': " + error);
}
Expand All @@ -93,12 +94,6 @@ function parseLine(lineString) {
line[name] = value;
}
}

line.text = lineString.substring(0, separatorIndex);

} else {
// Line has no attributes
line.text = lineString;
}

let leadingDashes = line.text.search(/[^-]/);
Expand Down