On Mon, Nov 24, 2008 at 8:01 AM, alinome.net <[EMAIL PROTECTED]> wrote:
>
> I use some markups to remove undesired <p>...</p> created by my
> WikiCreole implementation. Now I'm trying to remove the spurious
> paragraphs around forms:
>
> MarkUp('end', 'paragraphsRemoveB18', '/<p><form /s', '<form ');
> MarkUp('end', 'paragraphsRemoveB19', '/<\/form><\/p>/s', '</form>');
>
> But something strange happens: the open "<form" is not found. Only the
> closing "</form>" is found. I have done all kind of tries (also with
> < instead of <) and I don't understand where's the difference.
> Those are the only markups about forms in my config files.
>
> At the end I have tried this desperate markup:
>
> MarkUp('end', 'paragraphsRemoveB19a', '/form/s', 'formidable');
>
> Every "</form>" is transtated to "</formidable>" (and all occurrence
> of the letters "form" in the page content), but no XHTML "<form" is
> changed!
>
> I surrender ---for a while. Any clue?The problem is surely that the opening form tag is escaped, so it is not actually inserted into the text until after all the markup rules are processed. My reason for escaping it was that there might be something in the output that might trigger another markup rule and cause problems. It's possible we could remove the escaping if this is a problem. But I suspect we might introduce other problems. There is also the BOLTreplacetable array which might be useful for simple string replacements. In fact this might be a good option for all your replacements that don't require regex. In a config file, try for example... $BOLTreplaceTable['HTML']['in'][] = '<br /><form'; $BOLTreplaceTable['HTML']['out'][] = '<form'; That should automatically strip out any <br /> before <form. Note: there are many other aspects to this function, beside replacing just finished HTML. You can also set OPEN, SAVE, SKIN, and various ZONE replace table arrays. And the whole ROS/ROE system uses the replace table. It's a very powerful way of doing things. Now that I think about it, I wonder if there are not some Markup Rules that couldn't be changed into replacetable rules... Maybe worth looking at some time... Cheers, Dan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
