in reply to Re: regex: deleting empty (x)html tags
in thread regex: deleting empty (x)html tags

In this case spec calls for an upload file function -- if the user was typing this into a text box, believe me I would use HTMLArea -- though given that it doesn't work on all browsers, unless you can honestly say that all the program's users all the time will have access to Moz or IE (and for instance my local public library, if you take a Mac you've only got Safari to work with), you really should have an alternate means of input anyway.

HTMLTidy is also a case of not working with spec (though goddess it would make my life simpler), because it requires access to the command line to install. This is a low end CMS -- assuming the required modules exist or are installed for you by your host (and nothing called for by this is too outre) all you'd need to use this is ftp access and permission to run cgis.

  • Comment on Re: Re: regex: deleting empty (x)html tags

Replies are listed 'Best First'.
3Re: regex: deleting empty (x)html tags
by jeffa (Bishop) on Feb 15, 2004 at 18:01 UTC

    Besides the fact that you never answered why you need to strip empty elements, or that you don't even seem to care about where they come from, i would say that given your set of constraints that you are stuck with the solution you have discovered for yourself. Personally, i strive to work in an environment where i control such issues, but then again, i am not developing "web tools" for the general public to use. My audience for my free code is experienced Perl programmers (i write CPAN modules) and i make a living by working for clients with specific needs.

    If i were pushing this product out, i would look into bundling HTMLTidy along with the application, but that's just me. ;)

    Best of luck to you, and if we help you in the future (you solved this one yourself ... this time >:)) and you make some money as a result of it, please don't be shy. ;)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    

      Sorry for not answering that -- well a) because the html cleaner/parser I've written (using HTML::PullParser) sometimes leaves them behind in unscrambling jumbled html (because it doesn't know the difference between <i>hjhk<b>hjhkj</i>hkjhk</b> and <i>kkp<b>ttyt</i></b> and reopens the b tag after the /i), and b) even if they were only there when the user/user's html generator left them in they're pointless (especially given how harshly I've cleaned the code otherwise), and take up extra space and bandwidth.

      And how exactly do you mean 'bundling' it? This application isn't tied to one os much less one type of hardware -- and you need to know that to provide a binary. A list of choices is just going to confuse them. *pictures self spending life helping people who downloaded the Win32 version because that's what their desktop is.* For a module or corprate application you can assume that the person installing it isn't totally braindead, and understands a little about the server -- there are days I want to stick my more braindead adminuser user cases in a firepit, unfortunately they're realistic. :|

      Thanks, and if I do, I will :) hell if I become less insolvent in general I prolly will whether or not this project makes money ;)