I am working with some HTML for my site, basically moving my site from PHP to Rails.
I have thousands of pages and some parts of the site have different CSS files from others.
I can grab the <link> tags fine but I added some conditions for different stylesheets to be loaded if it's IE6/IE7/IE8 etc.
I am trying to figure out how to parse this:
<!--[if lt IE 7]>
<link type="text/css" rel="stylesheet" media="all" href="/templates/default/css/ie6.css" />
<![endif]-->
<!--[if IE 7]>
<link type="text/css" rel="stylesheet" media="all" href="/templates/default/css/ie7.css" />
<![endif]-->
<!--[if IE 8]>
<link type="text/css" rel="stylesheet" media="all" href="/templates/default/css/ie8.css" />
<![endif]-->
And end up with:
/templates/default/css/ie6.css<br />
/templates/default/css/ie7.css<br />
/templates/default/css/ie8.css<br />
I am using Nokogiri to pull any other information I need, but can not get these URLs due to them being wrapped in comments.