Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL in [ ] breaks output HTML #51

Open
kenjis opened this issue Jan 1, 2015 · 1 comment
Open

URL in [ ] breaks output HTML #51

kenjis opened this issue Jan 1, 2015 · 1 comment

Comments

@kenjis
Copy link

kenjis commented Jan 1, 2015

<?php
require 'vendor/autoload.php';

use Ciconia\Ciconia;
use Ciconia\Extension\Gfm;

$ciconia = new Ciconia();
$ciconia->addExtension(new Gfm\FencedCodeBlockExtension());
$ciconia->addExtension(new Gfm\TaskListExtension());
$ciconia->addExtension(new Gfm\InlineStyleExtension());
$ciconia->addExtension(new Gfm\WhiteSpaceExtension());
$ciconia->addExtension(new Gfm\TableExtension());
$ciconia->addExtension(new Gfm\UrlAutoLinkExtension());

$html = $ciconia->render(
    '[phalcon-php.spec - See http://blog.ohgaki.net/phalcon-php-rpm-package](https://gist.github.com/yohgaki/ee26b252d85ac6655c16)'
);

echo $html, PHP_EOL;

Actual result:
<p><a href="https://gist.github.com/yohgaki/ee26b252d85ac6655c16">phalcon-php.spec - See <a href="http://blog.ohgaki.net/phalcon-php-rpm-package</a">http://blog.ohgaki.net/phalcon-php-rpm-package</a</a>></p>

Expected result:
<p><a href="https://gist.github.com/yohgaki/ee26b252d85ac6655c16">phalcon-php.spec - See http://blog.ohgaki.net/phalcon-php-rpm-package</a></p>

@willvincent
Copy link

This probably isn't a bug considering you've included the UrlAutoLinkExtension class. If you're going to use normal markdown style named links, inclusion of the autolink extension probably isn't the best idea.

Though the regex pattern might be able to be updated to ignore any url wrapped inside square brackets or parens, since those matches would be picked up by the core link parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants