Zend Framework

list+url

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.10.2
  • Component/s: Zend_Markup
  • Labels:
    None

Description

last version from /trunk

$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;
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 />
<h3>Foo:</h3><br />
<ul><li> <a href="http://request.html&quot;]Request[/url][newline�]	[*] [url=&quot;settings.html&quot;]Settings[/url][newline�]	[*] [url=&quot;database.html&quot;]Database[/url][newline�]	[*] [url=&quot;paginator.html">Paginator</a></li><li> <del>Cache</del> in process</li><li> Additional functions</li></ul><br />
"

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.

Activity

Hide
Dolf Schimmel (Freeaqingme) added a comment -

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

Show
Dolf Schimmel (Freeaqingme) added a comment - Imho is point 2 bogus. This component isn't meant to beautify HTML, it's meant to output that (at least this renderer is).
Hide
Konstantin.Myakshin added a comment -

Maybe. But sometimes it useful for debugging.

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

ps: sorry for horisontal scroll-bar)

Show
Konstantin.Myakshin added a comment - Maybe. But sometimes it useful for debugging. Also relative path needed for anchor links url=#title1title1[/url] ps: sorry for horisontal scroll-bar)
Hide
Pieter Kokx added a comment -

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.

Show
Pieter Kokx added a comment - 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.
Hide
Pieter Kokx added a comment -

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

$parser = $bbcode->getParser();

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

Thats much more useful than the output itself.

Show
Pieter Kokx added a comment - Also, if you want something that is useful for debugging, do something like:
$parser = $bbcode->getParser();

var_dump($parser->parse('[b]test[/b]'));
Thats much more useful than the output itself.
Hide
Pieter Kokx added a comment -

Added a unit test with a simplified usecase for this.

Show
Pieter Kokx added a comment - Added a unit test with a simplified usecase for this.
Hide
Konstantin.Myakshin added a comment -

thank you for fast replay at weekend .

Show
Konstantin.Myakshin added a comment - thank you for fast replay at weekend .
Hide
Pieter Kokx added a comment -

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

Show
Pieter Kokx added a comment - Fixed in r21127 and r21128 (merge into 1.10 release branch).

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: