Created
April 22, 2015 08:53
-
-
Save anonymous/b1c756780c2f34518585 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
test = Nokogiri::HTML(' | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
</head> | |
<body bgcolor="#FFFFFF" text="#000000"> | |
priority: Sofort | |
<br> | |
das ist nur ein test<br> | |
<br> | |
blub<br> | |
<br> | |
schwups<br> | |
<br> | |
bla<br> | |
<br> | |
</body> | |
</html> | |
').text | |
test.gsub!(/^\s+/, '') | |
test.gsub!(/\s+$/, '') | |
puts test | |
root@wiki:/srv/data/redmineKautBullinger/test/html# ruby html.rb | |
priority: Sofort | |
das ist nur ein test | |
blub | |
schwups | |
bla | |
root@wiki:/srv/data/redmineKautBullinger/test/html# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment