Skip to content

Inline anchors or images are either parsed incorrectly, or throw a PHP error (undefined offset: 6) #2

merged 1 commit into from Jun 21, 2012

2 participants

$text = "[Link text](";
echo Sparkdown\Markdown($text);
// returns
// Unhandled Exception: undefined offset: 6


$text = "[Link text]( 'Title')";
echo Sparkdown\Markdown($text);
// returns
// <a href="" title="'">Link text</a>

(the same applies for inline images)

I've modified _doAnchors_inline_callback and _doImages_inline_callback to check offset 7 for the title text (not 6), and am just returning null if it's not present.

Luke Martin Fixed bug in parser which caused titles in inline anchors/images to e…
…ither be parsed incorrectly, or throw a PHP error
@sparksp sparksp merged commit 17cd4b4 into sparksp:master Jun 21, 2012
sparksp commented Jun 21, 2012

Well spotted, thank-you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.