Skip to content

Commit 55e5a89

Browse files
committed
Require space before title in reference link
See commonmark/commonmark.js@fe38c537 and commonmark/cmark#263
1 parent a41f97f commit 55e5a89

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ReferenceParser.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ public function parse(Cursor $cursor)
8181
}
8282

8383
$previousState = $cursor->saveState();
84-
$cursor->advanceToNextNonSpaceOrNewline();
8584

86-
$title = LinkParserHelper::parseLinkTitle($cursor);
87-
if ($title === null) {
85+
if ($cursor->advanceToNextNonSpaceOrNewline() > 0) {
86+
$title = LinkParserHelper::parseLinkTitle($cursor);
87+
}
88+
89+
if (!isset($title)) {
8890
$title = '';
8991
$cursor->restoreState($previousState);
9092
}

0 commit comments

Comments
 (0)