[pmwiki-users] Images markup

kirpi at kirpi.it kirpi at kirpi.it
Sat Dec 12 15:49:07 CST 2015


There is a stdmarkup.php file in the /scripts/ folder which contains a
few lines commented as
   ## Lines that begin with displayed images…
Trying to move one more step forward, I mixed things up and added to
my config.php these lines

$ImgTagFmt="<figure><img src='\$LinkUrl' alt='\$LinkAlt'
title='\$LinkAlt'
/><footer><small>Copyright</small></footer></figure>";
Markup_e('^img', 'block',
  "/^((?>(\\s+|%%|%[A-Za-z][-,=:#\\w\\s'\".]*%)*)$KeepToken(\\d+L)$KeepToken)(\\s*\\|\\s?)?(.*)$/",
  "(strpos(\$GLOBALS['KPV'][\$m[3]],'<img')===false) ? \$m[0] :
       '<:block,1><div class=\"img\">'.\$m[1] .
       (\$m[4] ? '<br /><figcaption
class=\"caption\">'.\$m[5].'</figcaption>' : \$m[5]) . '</div>'");

While it's surely a mess from the point of view of those who
understand what those lines mean, to my eyes it seems again one more
demonstration that it should be feasable.
The html page resulting from this code is not too far from the goal.
If only that code would be less similar to hieroglyphic writing, I'm
sure I could tweak it before tomorrow.

Yet my main question remains (apart form the "how to"): would it be a
good thing to try and evolve things in this direction?

Thanks!

Luigi



More information about the pmwiki-users mailing list