Skip to content

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

Merged
merged 1 commit into from Jun 21, 2012

2 participants

@lukemartin
$text = "[Link text](http://google.com/)";
echo Sparkdown\Markdown($text);
// returns
// Unhandled Exception: undefined offset: 6

And

$text = "[Link text](http://google.com/ 'Title')";
echo Sparkdown\Markdown($text);
// returns
// <a href="http://google.com/" 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
10e9f4d
@sparksp sparksp merged commit 17cd4b4 into sparksp:master Jun 21, 2012
@sparksp
Owner
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.