Issues

ZF-9220: list+url

Issue Type: Bug Created: 2010-02-21T05:27:36.000+0000 Last Updated: 2010-02-21T13:03:18.000+0000 Status: Resolved Fix version(s): - 1.10.2 (24/Feb/10)

Reporter: Konstantin.Myakshin (koc) Assignee: Pieter Kokx (kokx) Tags: - Zend_Markup

Related issues: Attachments: - ZF-9220-test.patch

Description

last version from /trunk

<pre class="highlight">
$bbcode = Zend_Markup::factory('Bbcode', 'Html', array('encoding' => 'windows-1251'));

$a = '
[h3]Foo:[/h3]
[list]
    [*] [url="request.html"]Request[/url]
    [*] [url="settings.html"]Settings[/url]
    [*] [url="database.html"]Database[/url]
    [*] [url="paginator.html"]Paginator[/url]
    [*] [s]Cache[/s] in process
    [*] Additional functions
[/list]
';
$b = $bbcode->render($a);
var_dump($a, $b);
exit;



<pre class="highlight">
string(259) "
[h3]Foo:[/h3]
[list]
    [*] [url="request.html"]Request[/url]
    [*] [url="settings.html"]Settings[/url]
    [*] [url="database.html"]Database[/url]
    [*] [url="paginator.html"]Paginator[/url]
    [*] [s]Cache[/s] in process
    [*] Additional functions
[/list]
"
string(343) "<br></br>

Foo:

<br></br> Paginator Cache in process Additional functions

"

  1. why "http://request.html"? I don't need absolute url, relative needed 2) generated markup isn't readable because it printed in one string 3) generated markup isn't correct

I think that problem appears because url wrapped with quotes. But some links need this wrapping.

Comments

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-02-21T06:12:14.000+0000

Imho is point 2 bogus. This component isn't meant to beautify HTML, it's meant to output that (at least this renderer is).

Posted by Konstantin.Myakshin (koc) on 2010-02-21T06:19:51.000+0000

Maybe. But sometimes it useful for debugging.

Also relative path needed for anchor links [url=#title1]title1[/url]

ps: sorry for horisontal scroll-bar)

Posted by Pieter Kokx (kokx) on 2010-02-21T06:27:00.000+0000

The default URL tag doesn't use relative URL's at all, all URL's are handled as absolute URL's by default.

This behaviour seems to be caused by the fact that the first " is found, but it only uses the last ". Its not really correct behaviour, and I'm going to fix it ASAP.

Posted by Pieter Kokx (kokx) on 2010-02-21T06:35:11.000+0000

Also, if you want something that is useful for debugging, do something like:

<pre class="highlight">$parser = $bbcode->getParser();

var_dump($parser->parse('[b]test[/b]'));

Thats much more useful than the output itself.

Posted by Pieter Kokx (kokx) on 2010-02-21T06:45:53.000+0000

Added a unit test with a simplified usecase for this.

Posted by Konstantin.Myakshin (koc) on 2010-02-21T07:11:36.000+0000

thank you for fast replay at weekend (y).

Posted by Pieter Kokx (kokx) on 2010-02-21T07:40:59.000+0000

Fixed in r21127 and r21128 (merge into 1.10 release branch).

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts