kzykhys / Ciconia

A New Markdown parser for PHP5.4
http://ciconia.kzykhys.com/
MIT License
355 stars 31 forks source link

Wrong rendering with Gfm\UrlAutoLinkExtension() #35

Open t3chn0r opened 10 years ago

t3chn0r commented 10 years ago

I use Redactor as the entry point for text. This is rich editor so the text for example when I enter a simple URL is coming raw like this:

<p>https://github.com/kzykhys/Ciconia</p>

I'm rendering the with the extension Gfm\UrlAutoLinkExtension() and the results are these:

<p><p><a href="https://github.com/kzykhys/Ciconia</">https://github.com/kzykhys/Ciconia</</a>p></p>

I'm processing the text with Ciconia with the following extensions:

        $ciconia = new Ciconia();
        $ciconia->removeExtension('header');
        $ciconia->removeExtension('code');
        $ciconia->removeExtension('image');
        $ciconia->addExtension(new Gfm\UrlAutoLinkExtension());
        $text = $ciconia->render($text);

My guess is there's something wrong with regexp being used but not sure how to fix it. I'll appreciate any help.

Regards