Hi all,
Asked this question a while ago but didn't get much response to my thread. I'm unfamiliar with much of regular expressions so I may not require them, but I can't think of another way to achieve the result without them.
As stated in the past thread, I've been messing with the Joomla! core files and have written a little SEO code using a simple replace expression.
Problem is I have certain parts of articles where I don't want any replacement. Namely, inside <pre></pre>, I would like the text to remain unchanged. To summarise I want to take this:
And convert it to:PHP Code:Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla lacinia interdum tincidunt. Aliquam erat volutpat.
Maecenas sodales auctor justo, eu suscipit tortor lacinia sit amet.
Aliquam lacinia molestie enim at lacinia.
Etc., etc.PHP Code:Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<a href="http://www.google.com">Nulla</a> lacinia interdum tincidunt.
<a href="http://www.yahoo.com">Aliquam</a> erat volutpat.
Maecenas sodales auctor justo, eu suscipit tortor lacinia sit amet.
Aliquam lacinia molestie enim at lacinia.
However, if the above paragraph should occur inside <pre></pre>, it should ignore it. Got no problem at all converting keywords to links, that's easy, but have no clue how to write the necessary regular expression to ignore all text within the named tags.
Also I realise there's plenty of Joomla! extensions to add links, but I'm not interested in installing those for unimportant reasons.
Cheers.


Reply With Quote
Bookmarks