Skip to content

Commit

Permalink
Bugfix: Ensure bullet-style lines are parsed as plain text when not
Browse files Browse the repository at this point in the history
within either a

* A simple array
* An array whose type hasn't yet been decided

Updated tests to reflect this edge case.

Fixes #19
  • Loading branch information
abstrctn committed Jul 11, 2016
1 parent d7fab0d commit e0fab24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions archieml.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ function load(input, options) {

parseCommandKey(match[1].toLowerCase());

} else if (!isSkipping && startKey.exec(input) && (!stackScope || stackScope.arrayType !== 'simple')) {
} else if (!isSkipping && startKey.exec(input) &&
(!stackScope || stackScope.arrayType !== 'simple')) {
match = startKey.exec(input);

parseStartKey(match[1], match[2] || '');

} else if (!isSkipping && arrayElement.exec(input) && stackScope && stackScope.arrayType !== 'complex') {
} else if (!isSkipping && arrayElement.exec(input) && stackScope && stackScope.array &&
(stackScope.arrayType !== 'complex' && stackScope.arrayType !== 'freeform') &&
stackScope.flags.indexOf('+') < 0) {
match = arrayElement.exec(input);

parseArrayElement(match[1]);
Expand Down Expand Up @@ -194,6 +197,7 @@ function load(input, options) {
};
if (scopeType == '[') {
stackScopeItem.array = keyScope[parsedScopeKey] = [];
if (flags.indexOf('+') > -1) stackScopeItem.arrayType = 'freeform';
if (nesting) {
stack.push(stackScopeItem);
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/archieml.org

0 comments on commit e0fab24

Please sign in to comment.