Skip to content

Commit

Permalink
Don't allow list items that are indented >= 4 spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Sep 18, 2018
1 parent 8bee4a8 commit af10470
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Block/Parser/ListParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@ public function parse(ContextInterface $context, Cursor $cursor)
return false;
}

$indent = $cursor->getIndent();
if ($indent >= 4) {
return false;
}

$tmpCursor = clone $cursor;
$tmpCursor->advanceToNextNonSpaceOrTab();
$rest = $tmpCursor->getRemainder();

$data = new ListData();
$data->markerOffset = $cursor->getIndent();
$data->markerOffset = $indent;

if (preg_match('/^[*+-]/', $rest) === 1) {
$data->type = ListBlock::TYPE_UNORDERED;
Expand Down

0 comments on commit af10470

Please sign in to comment.