When there are one or more spaces after a link label, one space is
included in the link if there are additional attributes:
[[page | no spaces included ]]
[[page | one space included | title='aoeu aoeu aoeu']]
[[page | one space included | title='aoeu aoeu aoeu']]
It seems a second trim() is needed in BOLTMlinks because of an if
structure:
if (strpos($x, "|") !== false) {
$link = substr($x, 0, strpos($x, "|"));
$label = trim(substr($x, strpos($x, "|") + 1));
if ($label == '') $label = $link;
elseif (strpos($label, '|') !== false) {
$attrs = stripslashes(substr($label, strrpos($label,
'|') + 1));
$label = trim(substr($label, 0, strrpos($label, '|')));
// TRIM
ADDED
Another option (to prevent future bugs because of additional if
structures) is to add the following line:
$label = trim($label);
after the current line:
$link = trim($link);
I'm tinkering deeply with the BOLTMlinks function. I think I will be
able to make it simpler, faster and more legible, with less control
structures (in general, they make code harder to debug and modify).
I.e., the link components can be extracted right at the start with no
control structure, what saves code later:
list($link,$label,$attrs) = explode('|',$x,3);
$link = trim($link);
$label = trim($label);
$attrs = trim($attrs);
$label = empty($label) || $label=='=' ? $link : $label;
if (!empty($attrs)) {
At the same time I'll try to implement my idea about optional non-
links for missing pages. There are some points I don't understand in
the code, so I will need some help.
Regards,
Marcos
--
http://alinome.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---