#71 open
Mathijs Kwik

tidy html output

Reported by Mathijs Kwik | July 29th, 2008 @ 01:39 AM | in Beyond Hobo 1.0

Dryml's html output is horrible. Apart from some things not validating(which will get fixed bit by bit overtime), it looks as if it was edited using Microsoft Word just before saving.

In the long run we might need some indentation-counting html-analyzing&parsing code to clean things up (I believe this is how haml does this atm), but for short-term we should take a look at using htmltidy as an after_filter. Since tidy is written in C, it might also be faster than any ruby-based solution, so if it satisfies, we might end up keeping it.

Comments and changes to this ticket

  • Tom Locke

    Tom Locke July 29th, 2008 @ 09:08 AM

    • Milestone cleared.

    Changing the milestone to 0.9 - we hope to get 0.8 this week or next at the latest.

  • Tom Locke

    Tom Locke July 29th, 2008 @ 10:56 AM

    • State changed from “new” to “open”
  • Mathijs Kwik

    Mathijs Kwik July 29th, 2008 @ 08:56 PM

    Since the tidy-gem (http://tidy.rubyforge.net) segfaults on my system (ubuntu linux x86_64) I just decided to use the 'tidy' executable on my system.

    Since ruby-tidy requires libtidy installed anyway (external dependency), depending on the executable itself doesn't feel like an issue (except for performance maybe).

    If your system knows 'tidy', use this in your application controller:

    after_filter :tidy

    protected

    def tidy

    response.body = IO.popen('tidy -q -u -utf8 -i -w 120 -asxhtml 2>/dev/null', 'w+') do |pipe|

    pipe.write(response.body)

    pipe.close_write

    pipe.read

    end

    end

    To have a quick look.

    Not sure how to continue though.

    Dryml's whitespace problem still exists, but is masqueraded now.

    Also, since tidy (or libtidy if ruby-tidy doesn't segfault anymore) is an external dependency, we should check for its presence. But even if we find that it's present, should we enable output-filtering by default or should we make it optional/configurable?

  • Tom Locke

    Tom Locke August 3rd, 2008 @ 11:07 AM

    • Tag changed from defect, dryml to dryml, enhancement

    I'd say this is an enhancement, given that nothing is actually broken by the extra whitespace

  • Tom Locke

    Tom Locke January 6th, 2009 @ 05:30 PM

    • Milestone set to Hobo 1.0 - Final

    Getting rid of 0.9 milestone. Hobo 0.9 will be essentially 1.0 release candidate

  • Tom Locke

    Tom Locke March 12th, 2009 @ 11:44 AM

    • Milestone changed from Hobo 1.0 - Final to Beyond Hobo 1.0

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages