Amaury / SkrivMarkup

Interpreter of the Skriv Markup Language.
GNU Lesser General Public License v2.1
25 stars 3 forks source link

bug with link in code #9

Closed marmotz closed 11 years ago

marmotz commented 11 years ago

source:

[[[shell
curl https://raw.github.com/atoum/atoum-installer/master/installer | php -- --phar
php mageekguy.atoum.phar -v
atoum version nightly-xxxx-yyyymmddhhmm by Frédéric Hardy (phar:///path/to/mageekguy.atoum.phar)
]]]

generated:

<pre class="shell">curl https://raw.github.com/atoum/atoum-installer/master/installer | php -- --phar
php mageekguy.atoum.phar -v
atoum version nightly-xxxx-yyyymmddhhmm by Frédéric Hardy ([[phar:///path/to/mageekguy.atoum.phar)]]</pre>

expected:

<pre class="shell">curl https://raw.github.com/atoum/atoum-installer/master/installer | php -- --phar
php mageekguy.atoum.phar -v
atoum version nightly-xxxx-yyyymmddhhmm by Frédéric Hardy (phar:///path/to/mageekguy.atoum.phar)</pre>

(phar link was converted to a skriv link but shouldn't)

Amaury commented 11 years ago

Interresting. In fact, there is a piece of code, activated before WikiRenderer, which goals is to transform "free-links" in marked-up links.

For example, http://skriv.org become [[http://skriv.org]], and in the end <a href="http://skriv.org">http://skriv.org</a>.

But this code is a little too aggressive. It transform anything that contains :// (it's a little bit more complex; take a look at \Skriv\Markup\Html\Config::onStart() to see the regular expression). More, its behaviour interfere with the image markup interpretation.

I will change that quickly.

Amaury commented 11 years ago

Second-thought... In fact, even if the pre-parser is too aggressive, the Code markup should prevent any interpretation inside its block. So, I have to completely re-think how it works...

Amaury commented 11 years ago

The last commit correct this issue. You must update SkrivMarkup and WikiRenderer.