break;
case TEXT_NUMBER_POSS_LIST:
- switch (source[first_child->next->start]) {
- case ' ':
- case '\t':
- line->type = LINE_LIST_ENUMERATED;
- first_child->type = MARKER_LIST_ENUMERATOR;
-
- switch (first_child->next->type) {
- case TEXT_PLAIN:
-
- // Strip whitespace between bullet and text
- while (char_is_whitespace(source[first_child->next->start])) {
- first_child->next->start++;
- first_child->next->len--;
- }
+ if (first_child->next) {
+ switch (source[first_child->next->start]) {
+ case ' ':
+ case '\t':
+ line->type = LINE_LIST_ENUMERATED;
+ first_child->type = MARKER_LIST_ENUMERATOR;
- break;
+ switch (first_child->next->type) {
+ case TEXT_PLAIN:
- case INDENT_SPACE:
- case INDENT_TAB:
- case NON_INDENT_SPACE:
- t = first_child;
+ // Strip whitespace between bullet and text
+ while (char_is_whitespace(source[first_child->next->start])) {
+ first_child->next->start++;
+ first_child->next->len--;
+ }
- while (t->next && ((t->next->type == INDENT_SPACE) ||
- (t->next->type == INDENT_TAB) ||
- (t->next->type == NON_INDENT_SPACE))) {
- tokens_prune(t->next, t->next);
- }
+ break;
- break;
- }
+ case INDENT_SPACE:
+ case INDENT_TAB:
+ case NON_INDENT_SPACE:
+ t = first_child;
- break;
+ while (t->next && ((t->next->type == INDENT_SPACE) ||
+ (t->next->type == INDENT_TAB) ||
+ (t->next->type == NON_INDENT_SPACE))) {
+ tokens_prune(t->next, t->next);
+ }
- default:
- line->type = LINE_PLAIN;
- first_child->type = TEXT_PLAIN;
- break;
+ break;
+ }
+
+ break;
+
+ default:
+ line->type = LINE_PLAIN;
+ first_child->type = TEXT_PLAIN;
+ break;
+ }
+ } else {
+ line->type = LINE_LIST_ENUMERATED;
+ first_child->type = MARKER_LIST_ENUMERATOR;
}
break;