Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-08-05 17:26:18

gago
Plugin Author
Registered: 2011-07-28
Posts: 24

sen_condenser

Hi,

I have created a small plugin condensing the HTML code wrapped by it.

Try it and maybe there are some people who can improve the RegEx. Thanks!

I think it would be even fine to extend the plugin that it can also condense CSS.

http://www.mediafire.com/?vwrsrorq9tgz98o

Regards gago


<txp:addicted />

Offline

#2 2011-08-05 19:53:09

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,096
Website GitHub Mastodon Twitter

Re: sen_condenser

Hi gago

Moved the thread in the right forum and upgraded you into a plugin author.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2011-08-05 21:05:18

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: sen_condenser

Welcome to plugin-authorhood!


Steve

Offline

#4 2011-08-06 06:09:22

gago
Plugin Author
Registered: 2011-07-28
Posts: 24

Re: sen_condenser

Hi and thanks! Did anyone try it? :)


<txp:addicted />

Offline

#5 2011-08-06 08:39:44

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: sen_condenser

Didn’t try it, but I did look at the code:
  • $thing is parsed three times. It should only be parsed once, at the beginning.
  • use an empty string '' instead of null;
  • the /i modifier isn’t necessary in the regexes you use, because none of the characters in the regex are case sensitive.
  • have you considered the effect on comments foo <tag <!-- > -->> bar and pre-formatted text <pre> foo\n\tbar</pre>?
  • how does this differ from pat_speeder and aks_header?

Offline

Board footer

Powered by FluxBB