Home arrow Forum

Remository Forum

 


dynedain

Karma: 0  
Modifying regex to exclude header tags - 2007/03/22 03:39 So one thing that bugs me on a site I'm working on is that glossarbot is good about not breaking up scripts, comments, links, etc, but does insert itself into things like headers

I tried modifying the regex:
Code:

 $htmlregex '#(<a .*?</a *>|<script .*?</script *>|</?.*?>|<![ rnt]*(--([^-]|[rn]|-[^-])*--[ rnt]*)>«»)#i' ;



to be:
Code:

 $htmlregex '#(<a .*?</a *>|<h.*?</h.*>|<script .*?</script *>|</?.*?>|<![ rnt]*(--([^-]|[rn]|-[^-])*--[ rnt]*)> «»)#i';



Thinking that adding <h.*?</h.*> would allow me to escape all header tags (<h1><h2><h3> etc.) from being replaced. This doesn't seem to work even though <h.*?</h.*> as a regular expresion on its own will select the tags.

Can anyone help me out?

Post edited by: dynedain, at: 2007/03/22 03:40
  | | Sorry, you do not currently have permission to write here.
dynedain

Karma: 0  
Re:Modifying regex to exclude header tags - 2007/03/22 04:05 So I think I figured out my own problem:

<h.*?</h.*> Does not allow for line breaks or carriage returns in the header tag.

On the other hand,

<[hH].*?(nr|n|r|rn)?.*?</[hH].> will allow for a variety of line breaks in the header tags, and is also case insensitive!
  | | Sorry, you do not currently have permission to write here.
zvaranka

Karma: 0  
Problems in appearance of glossary in weblinks - 2007/05/24 05:35 Hello!

If in a weblink text contains an glossary entry, the weblink does not remain weblink but only a flat text. My goal is in this case the glossarybot do not work insideweblinks. Is enouh, if I remove <a .*?</a *> from $htmlregex variable (line 215 in glossarbot.php - version 1.9.1) or the solution is diferente?

I attach an image to show the thing.



The weblink marked with red lines is not weblink but it must be weblink.

Thanks in advance...

Zoltan

Post edited by: zvaranka, at: 2007/05/24 04:36
  | | Sorry, you do not currently have permission to write here.

Login

Subscribe to Premium Support

Get priority support for Remository and Glossary, sign up now for a Premium Support monthly subscription:

Your Remository user name

Or purchase a year's support:

Your Remository user name

Recommended SEF

SEF Advance

Who is Online

Remository welcomes guests and visitors

We have 9 guest online