[pmwiki-devel] Extra <p> when adding fieldset to form markup

Hans design5 at softflow.co.uk
Wed Nov 22 04:11:51 CST 2006


Wednesday, November 22, 2006, 9:47:57 AM, marc wrote:

> I'm tying to add fieldset markup, but when the HTML is generated the
> tags are surrounded by unwanted <p> tags, which invalidates the HTML.

<fieldset> is a blocklevel element, so perhaps try this:

function AuxCells($name,$attr) {
        $name = strtolower($name);
        $attr = PQA($attr);
        switch ($name) {
                case 'fieldsetend';
                $out = '<:block></fieldset>';
                break;
                case 'fieldset';
                $out = "<:block><fieldset $attr>";
                break;
        }
        return $out;
}

Markup('auxcells', 'block',
  '/^\\(:(fieldset|fieldsetend|legend|legendend)(\\s.*?)?:\\)/ie',
  "AuxCells('$1',PSS('$2'))");


Hans




More information about the pmwiki-devel mailing list