Skip to content

Commit

Permalink
Test Nokogiri's handling of bad markup around tables. Closes premailer#7
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdunae committed Nov 3, 2010
1 parent dfc5411 commit d518d1f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/test_misc.rb
Expand Up @@ -15,4 +15,29 @@ def test_parsing_extra_quotes
premailer = Premailer.new(io)
assert_match /<h3>[\s]*<a name="WAR">[\s]*<\/a>[\s]*Writes and Resources[\s]*<\/h3>/i, premailer.to_inline_css
end

# in response to https://github.com/alexdunae/premailer/issues#issue/7
def test_parsing_bad_markup_around_tables
html = <<END_HTML
<html>
<style type="text/css">
.style3 { font-size: xx-large; }
.style5 { background-color: #000080; }
</style>
<tr>
<td valign="top" class="style3">
<!-- MSCellType="ContentHead" -->
<strong>PROMOCION CURSOS PRESENCIALES</strong></td>
<strong>
<td valign="top" style="height: 125px" class="style5">
<!-- MSCellType="DecArea" -->
<img alt="" src="../../images/CertisegGold.GIF" width="608" height="87" /></td>
</tr>
END_HTML

premailer = Premailer.new(html, :with_html_string => true)
premailer.to_inline_css
assert_match /font-size: xx-large/, premailer.processed_doc.search('.style3').first.attributes['style'].to_s
assert_match /background-color: #000080/, premailer.processed_doc.search('.style5').first.attributes['style'].to_s
end
end

0 comments on commit d518d1f

Please sign in to comment.