php-markdown icon indicating copy to clipboard operation
php-markdown copied to clipboard

runSpanGamut() performed twice on URL text in _doAnchors_inline_callback() function

Open paxter opened this issue 3 years ago • 2 comments

Is there a reason why runSpanGamut() is called twice on the same string in the _doAnchors_inline_callback() function?

Check out the _doAnchors_inline_callback() function in Markdown.php.

Line 754:

$link_text		=  $this->runSpanGamut($matches[2]);

Line 773:

$link_text = $this->runSpanGamut($link_text);

As far as I see the $link_text isn't used anywhere between these two lines. I can't find any reason for this. Maybe I'm missing something?

paxter avatar May 28 '22 16:05 paxter

That indeed serves no purpose, but should be harmless.

And it turns out you're not the first to comment on that. I should have fixed it then.

Feel free to submit a pull request if you want.

michelf avatar May 28 '22 17:05 michelf

Thanks for clarifying. I just wanted to be sure to don't miss anything. I extended the spanGamuts and just wondered, why I had unexpected results.

paxter avatar May 28 '22 17:05 paxter