Some interesting potential

10.12.05

For any that would like to replace class definitions with an id for block level tags, what follows should suggest some interesting potentials. Just a little tweeking in some tags would interchange class for id.
Could be interesting.

This idea was first suggested by Nate Hanna on TXP Resources, we’ll see where it goes from here.

//---------------- adapted from doWrap in taghandlers.php ------------------------------

function doWrapId($list, $wraptag, $break, $id='', $breakclass='', $atts='') { $atts = ($id ? $atts.' id="'.$id.'"' : $atts); $breakatts = ($breakclass ? ' class="'.$breakclass.'"' : ''); // non-enclosing breaks if (!preg_match('/^\w+$/', $break) or $break 'br' or $break ‘hr’) { if ($break 'br' or $break ‘hr’) $break = “<$break $breakatts/>”; return ($wraptag) ?tag(join($break.n,$list),$wraptag,$atts) :join($break.n,$list); } // enclosing breaks should be specified by name only, no ‘<' or '>’ if (($wraptag 'ul' or $wraptag ‘ol’) and empty($break)) $break = ‘li’; return ($wraptag) ? tag(tag(join(“”.n.”<{$break}{$breakatts}>”,$list),$break,$breakatts),$wraptag,$atts) : tag(join(“”.n.”<{$break}{$breakatts}>”,$list),$break,$breakatts); }

Rick Silletti

,

Section: article


Comment

Name
E-mail
http://
Message
  Textile Help