TextMate Local CSS Validation


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/usr/bin/env ruby -wKU
  2.  
  3. scope = STDIN.read
  4. scope.gsub!(/< \/?style.*?>/, '')
  5.  
  6. open('|curl -sF file=@-\;type=text/css -F lang=en http://jigsaw.w3.org/css-validator/validator', 'r+') do |io|
  7. io < < scope
  8. io.close_write
  9.  
  10. while io.gets
  11. $_.gsub!(/<\/title>/, '\&')
  12. print $_
  13. end
  14. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.